freqtweak-0.7.2/0000755000175200017520000000000011226201003012460 5ustar develdevelfreqtweak-0.7.2/doc/0000755000175200017520000000000011226201003013225 5ustar develdevelfreqtweak-0.7.2/doc/Makefile.am0000644000175200017520000000107411226173741015304 0ustar develdevel# Copyright (C) 2002 Jesse Chappell # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. docdir = $(datadir)/${PACKAGE}/help doc_DATA = \ usagehelp.html EXTRA_DIST = \ usagehelp.html freqtweak-0.7.2/doc/Makefile.in0000644000175200017520000002213111226200757015310 0ustar develdevel# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2002 Jesse Chappell # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ ARCH_486_FALSE = @ARCH_486_FALSE@ ARCH_486_TRUE = @ARCH_486_TRUE@ ARCH_586_FALSE = @ARCH_586_FALSE@ ARCH_586_TRUE = @ARCH_586_TRUE@ ARCH_686_FALSE = @ARCH_686_FALSE@ ARCH_686_TRUE = @ARCH_686_TRUE@ ARCH_CFLAGS = @ARCH_CFLAGS@ ARCH_PPC_FALSE = @ARCH_PPC_FALSE@ ARCH_PPC_TRUE = @ARCH_PPC_TRUE@ ARCH_TYPE = @ARCH_TYPE@ ARCH_ULTRA_FALSE = @ARCH_ULTRA_FALSE@ ARCH_ULTRA_TRUE = @ARCH_ULTRA_TRUE@ ARCH_X86_FALSE = @ARCH_X86_FALSE@ ARCH_X86_TRUE = @ARCH_X86_TRUE@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFTW_CFLAGS = @FFTW_CFLAGS@ FFTW_LIBS = @FFTW_LIBS@ FREQTWEAK_MAJOR_VERSION = @FREQTWEAK_MAJOR_VERSION@ FREQTWEAK_MICRO_VERSION = @FREQTWEAK_MICRO_VERSION@ FREQTWEAK_MINOR_VERSION = @FREQTWEAK_MINOR_VERSION@ FREQTWEAK_VERSION = @FREQTWEAK_VERSION@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JACK_CFLAGS = @JACK_CFLAGS@ JACK_LIBS = @JACK_LIBS@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIGCPP_CFLAGS = @SIGCPP_CFLAGS@ SIGCPP_LIBS = @SIGCPP_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ WX_CONFIG = @WX_CONFIG@ WX_CONFIG0 = @WX_CONFIG0@ WX_CONFIG1 = @WX_CONFIG1@ WX_CONFIG2 = @WX_CONFIG2@ WX_CONFIG3 = @WX_CONFIG3@ WX_CONFIG4 = @WX_CONFIG4@ XML_CFLAGS = @XML_CFLAGS@ XML_LIBS = @XML_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = $(datadir)/${PACKAGE}/help dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ doc_DATA = \ usagehelp.html EXTRA_DIST = \ usagehelp.html subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = DIST_SOURCES = DATA = $(doc_DATA) DIST_COMMON = $(srcdir)/Makefile.in Makefile.am all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: docDATA_INSTALL = $(INSTALL_DATA) install-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(docdir) @list='$(doc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(docDATA_INSTALL) $$d$$p $(DESTDIR)$(docdir)/$$f"; \ $(docDATA_INSTALL) $$d$$p $(DESTDIR)$(docdir)/$$f; \ done uninstall-docDATA: @$(NORMAL_UNINSTALL) @list='$(doc_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(docdir)/$$f"; \ rm -f $(DESTDIR)$(docdir)/$$f; \ done tags: TAGS TAGS: ctags: CTAGS CTAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(docdir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-docDATA install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-docDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-docDATA \ install-exec install-exec-am install-info install-info-am \ install-man install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-docDATA uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: freqtweak-0.7.2/doc/usagehelp.html0000644000175200017520000002100111226173741016103 0ustar develdevel Features and Usage

Features and Usage

FreqTweak supports manipulating the spectral filters at several frequency resolutions (64,128,256,512,1024,2048, or 4096 bands) depending on your needs/resources. Overlap and windowing are also selectable.

The GUI filter graph manipulators (and analysis plots) have selectable frequency scale types: 1x and 2x linear, and two log scales to help with modulating the musical frequencies. Filters can be linked across multiple channels. The plots are resizable and zoomable (y-axis) to allow precise editing of filter values.

The current processing filters are described below in the order audio is processed in the chain. Any or all of the filters can be bypassed. The state of all filters can be stored or loaded as presets.

  • Spectral Analysis -- Multicolor scrolling-raster spectrogram, or energy vs. freq line or bar plots... one shows pre-processed, another shows post-processed.
  • EQ Boost/Cut -- Your basic multi-band frequency attenuation. But you get an unhealthy number of bands... Note that this EQ is not intended for mastering purposes, it allows for (and doesn't protect against) highly irregular filtering. Two versions, one does only frequency gain cut, the other boost.
  • Pitch Scaling -- This is an interesting application of Sprengler's pitch scaling algorithm (used in Steve Harris' LADSPA plugin). If you keep all the bins at the same scale, it is equivalent to Steve's plugin, but when you start applying different scales per frequency bin, things quickly get weird. For highest quality results (at the expense of transients) use larger FFT (>= 1024 bins).
  • Gate -- This is a double filter where a given frequency band is allowed to pass through (unaltered) if the power on that band is between two dB thresholds... otherwise its gain is clamped to 0.
  • Delay -- This lets you delay the audio on a per frequency-bin basis yielding some pretty wild effects (or subtle, if you are careful). A feedback filter controls the feedback of the delay per bin (be careful with this one). This is basically what Native Instrument's Spektral-Delay accomplishes. Granted, I don't have all the automated filter modulations (yet ;). See their website for audio examples of what is possible with this cool effect.
  • Limit -- This is very harsh brick wall limiter on a per-bin basis. It is not very pleasant, but can be interesting.
  • Compressor -- This is a massively multiband compressor. It will not behave quite like a normal time-domain compressor because of the inherent block processing of the FFT. Each frequency bin has its own compressor complete with Threshold, Ratio, Attack/Release time, and makeup gain. This is *not* suitable for mastering applications!
  • Warp -- This one is a little different, both axes represent frequency, and the identity matrix is unaltered audio. Changing the value (height) of a bin, reallocates the energy at that frequency to the new frequency bin represented by the height of the bar. For instance, if all bins are the same height, all the frequency energy is added to a single bin. This is a sensitive filter, the Log frequency scale is helpful here (it affects both axes).

Modulators
Modulators to an filter can be attached from the Modulations Window (Control->Modulators... Ctrl-M). Add a modulator by clicking on the Add Modulator... button and select from the choices. To attach a modulator to a filter, click on the Attach... button on the modulator panel and pick a filter. You can modulate many filters simultaneously. The text entry fields can be used to exactly set the slider values, by pressing enter/return after entering the number.

The following modulators are currently implemented, with more to come soon.

  • Rotate -- This will continually shift a filter horizontally at a constant definable Rate, wrapping when it reaches the edge. The edges are definable with the Min and Max Freq controls.
  • Rotate LFO -- The same as the above, except the shifting rate oscillates via LFO with its own Rate and Depth controls. Currently there are sine, triangle, and square waveform shapes. The frequency range that the modulator affects is definable with the Min and Max Freq controls.
  • Value LFO -- Shifts the values up and down with an LFO. The depth control here is percentage of total value range. The frequency range that the modulator affects is definable with the Min and Max Freq controls.
  • Randomize -- Randomizes the bin values between the given value bounds (as percentages of total range). Again, the frequency range that the modulator affects is definable with the Min and Max Freq controls.

Mouse Control
  • Left button click/drag to draw filters. If Control is down, the y-axis is fixed at the last cursor location (to draw nice horizontal lines). If Control and Alt are down you can draw nice arbitrary straight lines.
  • Right button drag to move filters around in space. The filters wrap around the left/right edges unless you hold down Control. Dragging with both left and right buttons down moves both primary and alternate together (on Gate).
  • Holding Shift modifies the alternate filter (on double filter graphs like Gate) for the previous operations.
  • Middle-button pops up frequency axis menu.
  • Ctrl-Alt right-click resets a filter to default values.
  • Shift-Ctrl-Alt Left-Drag zooms in on the y axis. Look at the status bar to see the values for the cursor itself and the values of the filter at the cursor's frequency. Shift-Ctrl-Alt Right click-release resets the Y-zoom to full.
  • The B and BA buttons mean Bypass and Bypass All respectively.
  • The L and LA buttons mean Link and Link All respectively.
  • The G and GS buttons mean Toggle Grid and Toggle Grid Snap respectively. The right button can be used on the Grid buttons to choose the grid resolution.

Tips
Here is an example of using freqtweak with an alsaplayer feeding it and output going to speakers (alsa_pcm:out_?) without using a JACK patchbay:
Start freqtweak first with this command line:

  freqtweak -n ft &

Then start alsaplayer like so:

   alsaplayer -o jack -d ft:in_1,ft:in_2 &

freqtweak-0.7.2/src/0000755000175200017520000000000011226201002013246 5ustar develdevelfreqtweak-0.7.2/src/FTprocI.cpp0000644000175200017520000000263511226173741015310 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include "FTprocI.hpp" FTprocI::FTprocI (const string & name, nframes_t samprate, unsigned int fftn) : _sampleRate(samprate), _fftN(fftn), _oversamp(4), _inited(false), _name(name), _confname(name) { } FTprocI::~FTprocI() { } void FTprocI::setBypassed (bool flag) { _bypassed = flag; for (FilterList::iterator filt = _filterlist.begin(); filt != _filterlist.end(); ++filt) { (*filt)->setBypassed (flag); } } void FTprocI::setId (int id) { _id = id; for (FilterList::iterator filt = _filterlist.begin(); filt != _filterlist.end(); ++filt) { (*filt)->setId(id); } } freqtweak-0.7.2/src/FTprocI.hpp0000644000175200017520000000576611226173741015325 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPROCI_HPP__ #define __FTPROCI_HPP__ #if HAVE_CONFIG_H #include #endif #include "FTtypes.hpp" #include "xml++.hpp" #include #include #include #include using namespace std; #include "FTtypes.hpp" #include "FTspectrumModifier.hpp" // Limit a value to be l<=v<=u #define LIMIT(v,l,u) ((v)<(l)?(l):((v)>(u)?(u):(v))) // to handle denormals #define FLUSH_TO_ZERO(fv) (((*(unsigned int*)&(fv))&0x7f800000)==0)?0.0f:(fv) class FTprocI { public: //typedef map FilterMap; typedef vector FilterList; virtual ~FTprocI(); virtual FTprocI * clone() = 0; virtual void initialize() = 0; virtual void process (fft_data *data, unsigned int fftn) = 0; virtual void setBypassed (bool flag); virtual void setId (int id); //virtual bool getBypassed () { return _bypassed; } virtual FTspectrumModifier * getFilter(unsigned int n) { if (n < _filterlist.size()) { return _filterlist[n]; } return 0; } virtual void getFilters (vector & filtlist) { filtlist.clear(); for (FilterList::iterator filt = _filterlist.begin(); filt != _filterlist.end(); ++filt) { filtlist.push_back ((*filt)); } } virtual void setFFTsize (unsigned int fftn) { _fftN = fftn; for (FilterList::iterator filt = _filterlist.begin(); filt != _filterlist.end(); ++filt) { (*filt)->setLength (fftn/2); } } virtual void setSampleRate (nframes_t rate) { _sampleRate = rate; } virtual nframes_t getSampleRate() { return _sampleRate; } virtual void setOversamp (int osamp) { _oversamp = osamp; } virtual int getOversamp() { return _oversamp; } virtual void setName (const string & name) { _name = name; } virtual const string & getName() { return _name; } virtual const string & getConfName() { return _confname; } virtual void setMaxDelay(float secs) {} virtual void reset() {} virtual bool useAsDefault() { return true; } protected: FTprocI (const string & name, nframes_t samprate, unsigned int fftn); bool _bypassed; nframes_t _sampleRate; unsigned int _fftN; int _oversamp; bool _inited; FilterList _filterlist; int _id; string _name; string _confname; }; #endif freqtweak-0.7.2/src/FTactiveBarGraph.cpp0000644000175200017520000014247011226173741017120 0ustar develdevel /* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif // For compilers that support precompilation, includes "wx/wx.h". #include #ifndef WX_PRECOMP #include #endif #include #include #include "FTactiveBarGraph.hpp" #include "FTspectrumModifier.hpp" #include "FTutils.hpp" #include "FTmainwin.hpp" #include "FTjackSupport.hpp" enum { FT_1Xscale=1000, FT_2Xscale, FT_LogaXscale, FT_LogbXscale, }; // the event tables connect the wxWindows events with the functions (event // handlers) which process them. It can be also done at run-time, but for the // simple menu events like this the static method is much simpler. BEGIN_EVENT_TABLE(FTactiveBarGraph, wxPanel) EVT_PAINT(FTactiveBarGraph::OnPaint) EVT_SIZE(FTactiveBarGraph::OnSize) EVT_LEFT_DOWN(FTactiveBarGraph::OnMouseActivity) EVT_LEFT_UP(FTactiveBarGraph::OnMouseActivity) EVT_RIGHT_DOWN(FTactiveBarGraph::OnMouseActivity) EVT_RIGHT_UP(FTactiveBarGraph::OnMouseActivity) EVT_MIDDLE_DOWN(FTactiveBarGraph::OnMouseActivity) EVT_MIDDLE_UP(FTactiveBarGraph::OnMouseActivity) EVT_MOTION(FTactiveBarGraph::OnMouseActivity) EVT_ENTER_WINDOW(FTactiveBarGraph::OnMouseActivity) EVT_LEAVE_WINDOW(FTactiveBarGraph::OnMouseActivity) EVT_MOTION(FTactiveBarGraph::OnMouseActivity) EVT_MENU (FT_1Xscale,FTactiveBarGraph::OnXscaleMenu) EVT_MENU (FT_2Xscale,FTactiveBarGraph::OnXscaleMenu) EVT_MENU (FT_LogaXscale,FTactiveBarGraph::OnXscaleMenu) EVT_MENU (FT_LogbXscale,FTactiveBarGraph::OnXscaleMenu) END_EVENT_TABLE() FTactiveBarGraph::FTactiveBarGraph(FTmainwin *win, wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style , const wxString& name) : wxPanel(parent, id, pos, size, style, name) //, _topHeight(4), _bottomHeight(4), _leftWidth(4, _rightWidth(4) , _width(1), _height(1) , _specMod(0), _topSpecMod(0), _min(0.0), _max(1.0), _absmin(0.0), _absmax(1.0) ,_mindb(-50.0), _maxdb(0.0), _absmindb(-60), _absmaxdb(0.0), _absposmindb(0.0f), _absposmaxdb(24.0) ,_minsemi(-12.0), _maxsemi(12), _absminsemi(-12), _absmaxsemi(12) , _tmpfilt(0), _toptmpfilt(0) , _barColor0(135, 207, 235), _barColor1(69, 130, 181) , _barColor2(46, 140, 87), _barColor3(143, 189, 143) ,_barColorDead(77,77,77) ,_tipColor(200,200,0) , _penColor(0,0,255), _gridColor(64,64,64) ,_backingMap(0) , _xScaleType(XSCALE_1X), _lastX(0) , _dragging(false), _zooming(false) , _mainwin(win) , _gridFlag(false), _gridSnapFlag(false) , _mouseCaptured(false), _bypassed(false) //, _boundsFont(8, wxDEFAULT, wxNORMAL, wxNORMAL, false, "Helvetica") , _boundsFont(8, wxDEFAULT, wxNORMAL, wxNORMAL) , _textColor(255,255,255) , _tempo(120) { SetBackgroundColour(*wxBLACK); _mainwin->normalizeFontSize(_boundsFont, 11, wxT("999")); _barBrush0.SetColour(_barColor0); _barBrush0.SetStyle(wxSOLID); _barBrush1.SetColour(_barColor1); _barBrush1.SetStyle(wxSOLID); _barBrush2.SetColour(_barColor2); _barBrush2.SetStyle(wxSOLID); _barBrush3.SetColour(_barColor3); _barBrush3.SetStyle(wxSOLID); _barBrushDead.SetColour(_barColorDead); _barBrushDead.SetStyle(wxSOLID); _bypassBrush.SetColour(wxColour(77,77,77)); _bypassBrush.SetStyle(wxSOLID); _tipBrush.SetColour(_tipColor); _tipBrush.SetStyle(wxSOLID); _bgBrush.SetColour(wxColour(30,50,30)); //_bgBrush.SetStyle(wxCROSS_HATCH); _barPen.SetColour(_penColor); _barPen.SetStyle(wxTRANSPARENT); _gridPen.SetColour(_gridColor); _gridPen.SetStyle(wxSOLID); _xscaleMenu = new wxMenu(wxT("")); _xscaleMenu->Append ( new wxMenuItem(_xscaleMenu, FT_1Xscale, wxT("1x Scale"))); _xscaleMenu->Append ( new wxMenuItem(_xscaleMenu, FT_2Xscale, wxT("2x Scale"))); _xscaleMenu->Append ( new wxMenuItem(_xscaleMenu, FT_LogaXscale, wxT("logA Scale"))); _xscaleMenu->Append ( new wxMenuItem(_xscaleMenu, FT_LogbXscale, wxT("logB Scale"))); // grid choices can't be determined until we get a specmod updateSize(); } FTactiveBarGraph::~FTactiveBarGraph() { if (_tmpfilt) delete [] _tmpfilt; if (_toptmpfilt) delete [] _toptmpfilt; if (_backingMap) delete _backingMap; delete _xscaleMenu; if (_specMod) _specMod->unregisterListener(this); if (_topSpecMod) _topSpecMod->unregisterListener(this); } void FTactiveBarGraph::refreshBounds() { // mainly to handle when certain units change if (!_specMod) return; _xscale = _width/(float)_specMod->getLength(); _min = _absmin = _specMod->getMin(); _max = _absmax = _specMod->getMax(); if (_specMod->getModifierType() == FTspectrumModifier::GAIN_MODIFIER) { _mindb = _absmindb; _maxdb = _absmaxdb; _absmin = valToDb(_absmin); // special case _absmax = valToDb(_absmax); // special case _min = dbToVal(_mindb); _max = dbToVal(_maxdb); } else if (_specMod->getModifierType() == FTspectrumModifier::POS_GAIN_MODIFIER) { _mindb = _absposmindb; _maxdb = _absposmaxdb; _absmin = valToDb(_absmin); // special case _absmax = valToDb(_absmax); // special case _min = dbToVal(_mindb); _max = dbToVal(_maxdb); } else if (_specMod->getModifierType() == FTspectrumModifier::SEMITONE_MODIFIER) { _minsemi = valToSemi(_min); _maxsemi = valToSemi(_max); } _mtype = _specMod->getModifierType(); makeGridChoices(true); recalculate(); } void FTactiveBarGraph::setSpectrumModifier (FTspectrumModifier *sm) { int origlength=-1; if (_specMod) { origlength = _specMod->getLength(); // unregister from previous _specMod->unregisterListener (this); } _specMod = sm; if (sm == 0) { return; } _specMod->registerListener (this); if (_specMod->getLength() != origlength) { if (_tmpfilt) delete [] _tmpfilt; _tmpfilt = new float[_specMod->getLength()]; } refreshBounds(); } void FTactiveBarGraph::goingAway (FTspectrumModifier * sm) { if (sm == _specMod) { // clean it up _specMod = 0; } else if (sm == _topSpecMod) { // clean it up _topSpecMod = 0; } } void FTactiveBarGraph::setTopSpectrumModifier (FTspectrumModifier *sm) { if (_topSpecMod) { // unregister from previous _topSpecMod->unregisterListener (this); } _topSpecMod = sm; if (sm == 0) { return; } _topSpecMod->registerListener (this); // should be same as other one _xscale = _width/(float)_topSpecMod->getLength(); _min = _absmin = _topSpecMod->getMin(); _max = _absmax = _topSpecMod->getMax(); if (_topSpecMod->getModifierType() == FTspectrumModifier::GAIN_MODIFIER) { _mindb = _absmindb; _maxdb = _absmaxdb; _absmin = valToDb(_absmin); // special case _absmax = valToDb(_absmax); // special case _min = dbToVal(_mindb); _max = dbToVal(_maxdb); } else if (_topSpecMod->getModifierType() == FTspectrumModifier::POS_GAIN_MODIFIER) { _mindb = _absposmindb; _maxdb = _absposmaxdb; _absmin = valToDb(_absmin); // special case _absmax = valToDb(_absmax); // special case _min = dbToVal(_mindb); _max = dbToVal(_maxdb); } else if (_topSpecMod->getModifierType() == FTspectrumModifier::SEMITONE_MODIFIER) { _minsemi = valToSemi(_min); _maxsemi = valToSemi(_max); } if (_toptmpfilt) delete [] _toptmpfilt; _toptmpfilt = new float[_topSpecMod->getLength()]; _mtype = _specMod->getModifierType(); makeGridChoices(true); recalculate(); } void FTactiveBarGraph::makeGridChoices (bool setdefault) { _gridChoices.clear(); _gridValues.clear(); float tscale; switch(_mtype) { case FTspectrumModifier::GAIN_MODIFIER: case FTspectrumModifier::POS_GAIN_MODIFIER: _gridChoices.push_back (wxT("1 dB")); _gridValues.push_back (1.0); _gridChoices.push_back (wxT("3 dB")); _gridValues.push_back (3.0); _gridChoices.push_back (wxT("6 dB")); _gridValues.push_back (6.0); _gridChoices.push_back (wxT("12 dB")); _gridValues.push_back (12.0); _gridChoices.push_back (wxT("18 dB")); _gridValues.push_back (18.0); _gridChoices.push_back (wxT("24 dB")); _gridValues.push_back (24.0); if (setdefault) { // default _gridFactor = 6.0; _gridChoiceIndex = 2; } break; case FTspectrumModifier::SEMITONE_MODIFIER: _gridChoices.push_back (wxT("1/2 semi")); _gridValues.push_back (0.5); _gridChoices.push_back (wxT("1 semi")); _gridValues.push_back (1.0); _gridChoices.push_back (wxT("2 semi")); _gridValues.push_back (2.0); _gridChoices.push_back (wxT("3 semi")); _gridValues.push_back (3.0); _gridChoices.push_back (wxT("4 semi")); _gridValues.push_back (4.0); _gridChoices.push_back (wxT("6 semi")); _gridValues.push_back (6.0); if (setdefault) { // default _gridFactor = 1.0; _gridChoiceIndex = 1; } break; case FTspectrumModifier::TIME_MODIFIER: _gridChoices.push_back (wxT("1000 msec")); _gridValues.push_back (1.0); _gridChoices.push_back (wxT("500 msec")); _gridValues.push_back (2.0); _gridChoices.push_back (wxT("250 msec")); _gridValues.push_back (4.0); _gridChoices.push_back (wxT("200 msec")); _gridValues.push_back (5.0); _gridChoices.push_back (wxT("100 msec")); _gridValues.push_back (10.0); _gridChoices.push_back (wxT("50 msec")); _gridValues.push_back (20.0); _gridChoices.push_back (wxT("25 msec")); _gridValues.push_back (40.0); _gridChoices.push_back (wxT("10 msec")); _gridValues.push_back (100.0); _gridChoices.push_back (wxT("5 msec")); _gridValues.push_back (200.0); _beatscutoff = _gridValues.size(); _gridChoices.push_back (wxT("")); _gridValues.push_back (0.0); // meter time tscale = 60.0 / _tempo; _gridChoices.push_back (wxT("1/16 beat")); _gridValues.push_back (tscale * 64.0); _gridChoices.push_back (wxT("1/8 beat")); _gridValues.push_back (tscale * 32.0); _gridChoices.push_back (wxT("1/4 beat")); _gridValues.push_back (tscale * 16.0); _gridChoices.push_back (wxT("1/3 beat")); _gridValues.push_back (tscale * 12.0); _gridChoices.push_back (wxT("1/2 beat")); _gridValues.push_back (tscale * 8.0); _gridChoices.push_back (wxT("1 beat")); _gridValues.push_back (tscale * 4.0); _gridChoices.push_back (wxT("2 beats")); _gridValues.push_back (tscale * 2.0); _gridChoices.push_back (wxT("4 beats")); _gridValues.push_back (tscale * 1.0); if (setdefault) { // default _gridFactor = 4.0; _gridChoiceIndex = 2; } break; case FTspectrumModifier::UNIFORM_MODIFIER: case FTspectrumModifier::RATIO_MODIFIER: _gridChoices.push_back (wxT("50 %")); _gridValues.push_back (2.0); _gridChoices.push_back (wxT("25 %")); _gridValues.push_back (4.0); _gridChoices.push_back (wxT("20 %")); _gridValues.push_back (5.0); _gridChoices.push_back (wxT("10 %")); _gridValues.push_back (10.0); _gridChoices.push_back (wxT("5 %")); _gridValues.push_back (20.0); if (setdefault) { // default _gridFactor = 10.0; _gridChoiceIndex = 3; } break; case FTspectrumModifier::FREQ_MODIFIER: break; case FTspectrumModifier::DB_MODIFIER: _gridChoices.push_back (wxT("1 dB")); _gridValues.push_back (1.0); _gridChoices.push_back (wxT("3 dB")); _gridValues.push_back (3.0); _gridChoices.push_back (wxT("6 dB")); _gridValues.push_back (6.0); _gridChoices.push_back (wxT("12 dB")); _gridValues.push_back (12.0); _gridChoices.push_back (wxT("18 dB")); _gridValues.push_back (18.0); _gridChoices.push_back (wxT("24 dB")); _gridValues.push_back (24.0); if (setdefault) { // default _gridFactor = 6.0; _gridChoiceIndex = 2; } break; default: break; } } void FTactiveBarGraph::setGridChoice (unsigned int index, bool writeextra) { if ( index < _gridValues.size()) { _gridFactor = _gridValues[index]; _gridChoiceIndex = index; if (writeextra) { writeExtra (_specMod != 0 ? _specMod : _topSpecMod); } recalculate(); } } void FTactiveBarGraph::setGridLines (bool flag, bool writeextra) { _gridFlag = flag; if (writeextra) { writeExtra (_specMod != 0 ? _specMod : _topSpecMod); } recalculate(); } void FTactiveBarGraph::setXscale(XScaleType sc, bool writeextra) { _xScaleType = sc; if (writeextra) { writeExtra (_specMod != 0 ? _specMod : _topSpecMod); } Refresh(FALSE); } void FTactiveBarGraph::setTempo(int bpm) { if (_tempo <= 0) return; // this is important!! _tempo = bpm; if (_mtype == FTspectrumModifier::TIME_MODIFIER) { makeGridChoices(); _gridFactor = _gridValues[_gridChoiceIndex]; recalculate(); } } bool FTactiveBarGraph::setMinMax(float min, float max) { FTspectrumModifier *specmod; if (_specMod) specmod = _specMod; else if (_topSpecMod) specmod = _topSpecMod; else return false; if (min >= specmod->getMin() && max <= specmod->getMax()) { _min = min; _max = max; recalculate(); return true; } else { Refresh(FALSE); } return false; } void FTactiveBarGraph::setGridSnap (bool flag, bool writeextra) { _gridSnapFlag = flag; if (writeextra) { writeExtra (_specMod != 0 ? _specMod : _topSpecMod); } } void FTactiveBarGraph::xToFreqRange(int x, float &fromfreq, float &tofreq, int &frombin, int &tobin) { float freqPerBin = FTjackSupport::instance()->getSampleRate()/(2.0 * (double)_specMod->getLength()); //printf ("specmod length = %d freqperbin=%g\n", _specMod->getLength(), freqPerBin); xToBinRange(x, frombin, tobin); fromfreq = freqPerBin * frombin; tofreq = freqPerBin * tobin + freqPerBin; } void FTactiveBarGraph::xToBinRange(int x, int &frombin, int &tobin) { if (!_specMod) { frombin = tobin = 0; return; } // converts x coord into filter bin // according to scaling int bin, lbin, rbin; int totbins = _specMod->getLength(); //float xscale = _width / (float)totbins; if (x < 0) x = 0; else if (x >= _width) x = _width-1; if (_xScaleType == XSCALE_1X) { bin = rbin = lbin = (int)(x / _xscale); //printf (" %d %g %d\n", x, bin*xscale, (int)(bin * xscale)); // find lowest with same x while ( ((int)((lbin-1)*_xscale) == x) && (lbin > 0)) { lbin--; } // find highest with same x while ( ((int)((rbin+1)*_xscale) == x) && (rbin < totbins-1)) { rbin++; } frombin = lbin; tobin = rbin; } else if (_xScaleType == XSCALE_2X) { float hxscale = _xscale * 2; if (x >= _width-2) { lbin = totbins/2; rbin = totbins-1; } else { bin = rbin = lbin = (int)(x / hxscale); //printf (" %d %g %d\n", x, bin*xscale, (int)(bin * xscale)); // find lowest with same x while ( ((int)((lbin-1)*hxscale) == x) && (lbin > 0)) { lbin--; } // find highest with same x while ( ((int)((rbin+1)*hxscale) == x) && (rbin < totbins>>1)) { rbin++; } } frombin = lbin; tobin = rbin; } else if (_xScaleType == XSCALE_LOGA) { if (x >= _width-1) { lbin = totbins/2; rbin = totbins-1; } else { float xscale = x / (float)_width; // use log scale for freq lbin = rbin = (int) ::pow ( (double) (totbins>>1), (double) xscale) - 1; // find lowest with same x while ( (lbin > 0) && ((int)(((FTutils::fast_log10(lbin) / FTutils::fast_log10(totbins/2)) * _width)) == x)) { lbin--; } // find highest with same x while ( (rbin < totbins>>1) && ((int)(((FTutils::fast_log10(rbin) / FTutils::fast_log10(totbins/2)) )) == x)) { rbin++; } } frombin = lbin; tobin = rbin; // printf ("bin %d fromx=%d tox=%d\n", bin, fromx, tox); } else if (_xScaleType == XSCALE_LOGB) { if (x >= _width-1) { lbin = (int) (totbins/3.0); rbin = totbins-1; } else { float xscale = x / (float)_width; // use log scale for freq lbin = rbin = (int) ::pow ( (double)(totbins/3.0), xscale) - 1; // find lowest with same x while ( (lbin > 0) && ((int)(((FTutils::fast_log10(lbin) / FTutils::fast_log10(totbins/3.0)) * _width)) == x)) { lbin--; } // find highest with same x while ( (rbin < (int)(totbins/3.0)) && ((int)(((FTutils::fast_log10(rbin) / FTutils::fast_log10(totbins/3.0)) )) == x)) { rbin++; } } frombin = lbin; tobin = rbin; // printf ("bin %d fromx=%d tox=%d\n", bin, fromx, tox); } else { frombin = 0; tobin = 0; } //printf ("x=%d frombin=%d tobin=%d\n", x, frombin, tobin); } int FTactiveBarGraph::xDeltaToBinDelta(int xdelt) { return (int) (xdelt / _xscale); } float FTactiveBarGraph::valDiffY(float val, int lasty, int newy) { float retval; if (_specMod->getModifierType() == FTspectrumModifier::GAIN_MODIFIER || _specMod->getModifierType() == FTspectrumModifier::POS_GAIN_MODIFIER) { // db scaled float vdb = valToDb (val); float ddb = ((lasty-newy)/(float)_height) * (_maxdb - _mindb) ; retval = dbToVal (vdb + ddb); } else if (_specMod->getModifierType() == FTspectrumModifier::SEMITONE_MODIFIER) { // semitone scaled float vsemi = valToSemi (val); float dsemi = ((lasty-newy)/(float)_height) * (_maxsemi - _minsemi) ; retval = semiToVal (vsemi + dsemi); } else { float shiftval = yToVal(newy) - yToVal(lasty); retval = ( val + shiftval); } if (_gridSnapFlag) { retval = snapValue(retval); } return retval; } void FTactiveBarGraph::binToXRange(int bin, int &fromx, int &tox) { if (!_specMod) { fromx = tox = 0; return; } // converts bin into x coord range // according to scaling int x, lx, rx; int totbins = _specMod->getLength(); //float xscale = _width / (float)totbins; if (bin < 0) bin = 0; else if (bin >= totbins) bin = totbins-1; if (_xScaleType == XSCALE_1X) { //bin = rbin = lbin = (int)(x / xscale); x = lx = rx = (int) (bin * _xscale); //printf (" %d %g %d\n", x, bin*xscale, (int)(bin * xscale)); // find lowest x with same bin while ( ((int)((lx-1)/_xscale) == bin) && (lx > 0)) { lx--; } // find highest with same x while ( ((int)((rx+1)/_xscale) == bin) && (rx < _width-1)) { rx++; } fromx = lx; tox = rx; } else if (_xScaleType == XSCALE_2X) { float hxscale = _xscale * 2; if (bin >= totbins>>1) { rx = (int) (totbins * _xscale); lx = rx - 2; } else { //bin = rbin = lbin = (int)(x / xscale); x = lx = rx = (int) (bin * hxscale ); //printf (" %d %g %d\n", x, bin*xscale, (int)(bin * xscale)); // find lowest x with same bin while ( ((int)((lx-1)/(hxscale)) == bin) && (lx > 0)) { lx--; } // find highest with same x while ( ((int)((rx+1)/hxscale) == bin) && (rx < _width-1)) { rx++; } } fromx = lx; tox = rx; } else if (_xScaleType == XSCALE_LOGA) { // use log scale for freq if (bin > totbins/2) { lx = rx = (int) (totbins * _xscale); } else if (bin == 0) { lx = 0; rx = (int) ((FTutils::fast_log10(bin+2) / FTutils::fast_log10(totbins*0.5)) * _width); } else { lx = (int) ((FTutils::fast_log10(bin+1) / FTutils::fast_log10(totbins*0.5)) * _width); rx = (int) ((FTutils::fast_log10(bin+2) / FTutils::fast_log10(totbins*0.5)) * _width); } fromx = lx; tox = rx; // printf ("bin %d fromx=%d tox=%d\n", bin, fromx, tox); } else if (_xScaleType == XSCALE_LOGB) { // use log scale for freq if (bin > (int)(totbins*0.3333)) { lx = rx = (int) (totbins * _xscale); } else if (bin == 0) { lx = 0; rx = (int) ((FTutils::fast_log10(bin+2) / FTutils::fast_log10(totbins*0.3333)) * _width); } else { lx = (int) ((FTutils::fast_log10(bin+1) / FTutils::fast_log10(totbins*0.3333)) * _width); rx = (int) ((FTutils::fast_log10(bin+2) / FTutils::fast_log10(totbins*0.3333)) * _width); } fromx = lx; tox = rx; // printf ("bin %d fromx=%d tox=%d\n", bin, fromx, tox); } else { fromx = 0; tox = 0; } //printf ("bin=%d fromx=%d tox=%d\n", bin, fromx, tox); } int FTactiveBarGraph::valToY(float val) { int y = 0; if (_specMod->getModifierType() == FTspectrumModifier::GAIN_MODIFIER ||_specMod->getModifierType() == FTspectrumModifier::POS_GAIN_MODIFIER) { // db scale it float db = valToDb(val); y = (int) (( (db - _mindb) / (_maxdb - _mindb)) * _height); //printf ("val=%g db=%g y=%d\n", val, db, y); } else if (_specMod->getModifierType() == FTspectrumModifier::SEMITONE_MODIFIER) { // go from octave to semitone float semi = valToSemi (val); y = (int) (( (semi - _minsemi) / (_maxsemi - _minsemi)) * _height); } else if (_specMod->getModifierType() == FTspectrumModifier::FREQ_MODIFIER) { if (_xScaleType == XSCALE_1X || _xScaleType == XSCALE_2X) { y = (int) ( (val - _min)/(_max-_min) * _height); } else if (_xScaleType == XSCALE_LOGA) { // use log scale for freq y = (int) ((FTutils::fast_log10(val+1) / FTutils::fast_log10(_absmax*0.5)) * _height); // printf ("bin %d fromx=%d tox=%d\n", bin, fromx, tox); } else if (_xScaleType == XSCALE_LOGB) { y = (int) ((FTutils::fast_log10(val+1) / FTutils::fast_log10(_absmax*0.3333)) * _height); } // scale it however the X scale is } else { y = (int) ( (val - _min)/(_max-_min) * _height); } //printf ("val to y: %g to %d\n", val, y); return y; } float FTactiveBarGraph::yToDb(int y) { return (((_height - y)/(float)_height) * (_maxdb-_mindb)) + _mindb ; } float FTactiveBarGraph::yToSemi(int y) { return (((_height - y)/(float)_height) * (_maxsemi-_minsemi)) + _minsemi ; } float FTactiveBarGraph::yToVal(int y) { float val = 0.0; if (_specMod->getModifierType() == FTspectrumModifier::GAIN_MODIFIER ||_specMod->getModifierType() == FTspectrumModifier::POS_GAIN_MODIFIER) { // go from db to linear float db = yToDb (y); val = dbToVal(db); //printf ("y=%d val=%g db=%g\n", y, val, db); } else if (_specMod->getModifierType() == FTspectrumModifier::SEMITONE_MODIFIER) { // go from semitone to octave float semi = (((_height - y)/(float)_height) * (_maxsemi-_minsemi)) + _minsemi ; // Up a semitone is * 1.0593 or 12 2 (12th root of 2) val = semiToVal(semi); //printf ("y=%d val=%g db=%g\n", y, val, db); } else if (_specMod->getModifierType() == FTspectrumModifier::FREQ_MODIFIER) { if (_xScaleType == XSCALE_1X || _xScaleType == XSCALE_2X) { val = (((_height - y) / (float)_height)) * (_max-_min) + _min; //y = (int) ( (val - _min)/(_max-_min) * _height); } else if (_xScaleType == XSCALE_LOGA) { // use log scale for freq //y = (int) ((FTutils::fast_log10(val) / FTutils::fast_log10(_absmax*0.5)) * _height); val = (int) ::pow ( (double) (_absmax*0.5), (double) (_height-y)/_height ) - 1; // printf ("bin %d fromx=%d tox=%d\n", bin, fromx, tox); } else if (_xScaleType == XSCALE_LOGB) { //y = (int) ((FTutils::fast_log10(val) / FTutils::fast_log10(_absmax*0.3333)) * _height); val = (int) ::pow ( (double) (_absmax*0.3333), (double) (_height-y)/_height ) - 1; } } else { val = (((_height - y) / (float)_height)) * (_max-_min) + _min; } return val; } float FTactiveBarGraph::snapValue(float val) { // takes a given value (as passed to the specmanip) // and snaps it to the nearest gridline float snapval = val; if (_specMod->getModifierType() == FTspectrumModifier::GAIN_MODIFIER) { // every 6 db float dbval = valToDb(val) / _gridFactor; float numDivs = ((_absmaxdb - _absmindb) / _gridFactor); float divdb = (_absmaxdb - _absmindb) / numDivs; snapval = divdb * rint(dbval); //printf ("gain snap: %g \n", snapval); snapval = dbToVal (snapval); } else if (_specMod->getModifierType() == FTspectrumModifier::POS_GAIN_MODIFIER) { // every 6 db float dbval = valToDb(val) / _gridFactor; float numDivs = ((_absposmaxdb - _absposmindb) / _gridFactor); float divdb = (_absposmaxdb - _absposmindb) / numDivs; snapval = divdb * rint(dbval); //printf ("gain snap: %g \n", snapval); snapval = dbToVal (snapval); } else if (_specMod->getModifierType() == FTspectrumModifier::SEMITONE_MODIFIER) { float semival = valToSemi(val) / _gridFactor; snapval = rint(semival) * _gridFactor; //printf ("semi snap: %g \n", snapval); snapval = semiToVal (snapval); } else if (_specMod->getModifierType() == FTspectrumModifier::TIME_MODIFIER) { // every 500 msec float updiv = val * _gridFactor; snapval = rint(updiv) / _gridFactor; } else if (_specMod->getModifierType() == FTspectrumModifier::UNIFORM_MODIFIER) { // every 0.2 float updiv = val * _gridFactor; snapval = rint(updiv) / _gridFactor; } else if (_specMod->getModifierType() == FTspectrumModifier::DB_MODIFIER) { // every 12 db float dbval = val / _gridFactor; float numDivs = ((_absmax - _absmin) / _gridFactor); float divdb = (_absmax - _absmin) / numDivs; snapval = divdb * rint(dbval); //printf ("gain snap: %g \n", snapval); } return snapval; } void FTactiveBarGraph::OnPaint(wxPaintEvent & event) { if (!_backingMap || !_specMod) { event.Skip(); return; } //printf ("ActiveBarGraph::OnPaint xscale=%g\n", _xscale); //Clear(); wxPaintDC dc(this); wxMemoryDC backdc; backdc.SelectObject(*_backingMap); int bincnt = _specMod->getLength(); //float barwidthF = _width / (float) barcnt; //int currx = 0; float *bvalues = 0, *tvalues=0; FTspectrumModifier * specmod = 0; if (_specMod) { bvalues = _specMod->getValues(); specmod = _specMod; } if (_topSpecMod) { tvalues = _topSpecMod->getValues(); specmod = _topSpecMod; } bool both = false; if (bvalues && tvalues) { both = true; } else if (!specmod) { return; } backdc.BeginDrawing(); backdc.SetBackground(_bgBrush); backdc.Clear(); // draw bars //backdc.SetBrush(_barBrush); backdc.SetPen(_barPen); /* if (_width == barcnt) { for (int i=0; i < barcnt; i++ ) { int val = (int) ( (values[i] - _min)/(_max-_min) * _height); backdc.DrawRectangle( i, _height - val, 1, val); } } */ for (int i=0; i < bincnt; i++ ) { int yu=0 , yl = _height; if (bvalues) { yu = _height - valToY (bvalues[i]); } if (tvalues) { yl = _height - valToY (tvalues[i]); } int leftx, rightx; binToXRange(i, leftx, rightx); //printf ("%08x: %d %d\n", (unsigned) this, leftx, rightx); // main bar if (_bypassed) { backdc.SetBrush(_bypassBrush); backdc.DrawRectangle( leftx, yu , rightx - leftx + 1, yl - yu); } else if (yu < yl) { if (both) { if (i%2==0) { backdc.SetBrush(_barBrush2); } else { backdc.SetBrush(_barBrush3); } } else { if (i%2==0) { backdc.SetBrush(_barBrush1); } else { backdc.SetBrush(_barBrush0); } } backdc.DrawRectangle( leftx, yu , rightx - leftx + 1, yl - yu); // top line backdc.SetBrush(_tipBrush); backdc.DrawRectangle( leftx, yu, rightx - leftx + 1, 2); backdc.DrawRectangle( leftx, yl, rightx - leftx + 1, 2); } else { backdc.SetBrush(_barBrushDead); backdc.DrawRectangle( leftx, yu , rightx - leftx + 1, yl - yu); } } // draw gridlines if (_gridFlag) { paintGridlines (backdc); } // draw min and max text backdc.SetFont(_boundsFont); wxCoord mtw, mth, xtw, xth; backdc.GetTextExtent(_maxstr, &xtw, &xth); backdc.GetTextExtent(_minstr, &mtw, &mth); backdc.SetTextForeground(*wxBLACK); backdc.DrawText(_maxstr, (_width - xtw) - 1, 1); backdc.DrawText(_minstr, (_width - mtw) - 1, (_height - mth) + 1); backdc.SetTextForeground(_textColor); backdc.DrawText(_maxstr, (_width - xtw) - 2, 0); backdc.DrawText(_minstr, (_width - mtw) - 2, (_height - mth)); if (_zooming) { // draw xor'd box backdc.SetLogicalFunction (wxINVERT); backdc.DrawRectangle ( 0, _topzoomY, _width, _bottomzoomY - _topzoomY); } backdc.EndDrawing(); // blit to screen dc.Blit(0,0, _width, _height, &backdc, 0,0); // event.Skip(); } void FTactiveBarGraph::paintGridlines(wxDC & dc) { int origfunc = dc.GetLogicalFunction(); wxPen origPen = dc.GetPen(); dc.SetPen(_gridPen); dc.SetLogicalFunction(wxOR); // draw grid lines list::iterator yend = _gridPoints.end(); for (list::iterator y = _gridPoints.begin() ; y != yend; ++y) { dc.DrawLine (0, *y, _width, *y); } dc.SetPen(origPen); dc.SetLogicalFunction(origfunc); } void FTactiveBarGraph::recalculate() { if (!_specMod) return; int totbins = _specMod->getLength(); _xscale = _width / (float)totbins; _gridPoints.clear(); wxString maxstr, minstr; if (_mtype == FTspectrumModifier::GAIN_MODIFIER || _mtype == FTspectrumModifier::POS_GAIN_MODIFIER) { } else if (_mtype == FTspectrumModifier::SEMITONE_MODIFIER) { maxstr = wxString::Format(wxT("%.3g"), _maxsemi); minstr = wxString::Format(wxT("%.3g"), _minsemi); } else { maxstr = wxString::Format(wxT("%.3g"), _max); minstr = wxString::Format(wxT("%.3g"), _min); } if (_specMod->getModifierType() == FTspectrumModifier::GAIN_MODIFIER || _specMod->getModifierType() == FTspectrumModifier::POS_GAIN_MODIFIER) { // every _gridFactor db _mindb = valToDb(_min); _maxdb = valToDb(_max); float numDivs = ((_absmax - _absmin) / _gridFactor); float divdb = _gridFactor; int y; float cdb; for (int i=1; i < (int)numDivs; ++i) { cdb = _absmax - (divdb * i); if (cdb <= _maxdb && cdb >= _mindb) { // add line y = (int) (( (cdb - _mindb) / (_maxdb - _mindb)) * _height); _gridPoints.push_back (_height - y); //printf ("gain grid %d: %g y=%d\n", i, cdb, y); } } _maxstr = wxString::Format(wxT("%.1f"), _maxdb); _minstr = wxString::Format(wxT("%.1f"), _mindb); } else if (_specMod->getModifierType() == FTspectrumModifier::SEMITONE_MODIFIER) { // every semitone _minsemi = valToSemi(_min); _maxsemi = valToSemi(_max); float numDivs = (_absmaxsemi - _absminsemi) / _gridFactor; float updiv = _gridFactor; int y; float cunit; for (int i=1; i < (int)numDivs; ++i) { cunit = _absmaxsemi - (updiv * i); if (cunit <= _maxsemi && cunit >= _minsemi) { // add line y = valToY(semiToVal(cunit)); _gridPoints.push_back (_height - y); //printf ("pitch grid %d: %g y=%d\n", i, cunit, y); } } _maxstr = wxString::Format(wxT("%+.1f"), _maxsemi); _minstr = wxString::Format(wxT("%+.1f"), _minsemi); } else if (_specMod->getModifierType() == FTspectrumModifier::TIME_MODIFIER) { // every 500 msec float updiv = 1 / _gridFactor; int y; for (float i=updiv; i < _absmax; i+=updiv) { if (i <= _max && i >= _min) { // add line y = valToY(i); _gridPoints.push_back (_height - y); //printf ("time grid: %g y=%d\n", i, y); } } if (_gridChoiceIndex >= _beatscutoff) { _maxstr = wxString::Format(wxT("%.2f"), _max * _tempo/60.0); _minstr = wxString::Format(wxT("%.2f"), _min * _tempo/60.0); } else { _maxstr = wxString::Format(wxT("%.0f"), _max * 1000); _minstr = wxString::Format(wxT("%.0f"), _min * 1000); } } else if (_specMod->getModifierType() == FTspectrumModifier::UNIFORM_MODIFIER) { // every 0.2 float updiv = 1 / _gridFactor; int y; for (float i=updiv; i < _absmax; i+=updiv) { if (i <= _max && i >= _min) { // add line y = valToY(i); _gridPoints.push_back (_height - y); //printf ("uniform grid: %g y=%d\n", i, y); } } _maxstr = wxString::Format(wxT("%.1f"), _max * 100); _minstr = wxString::Format(wxT("%.1f"), _min * 100); } else if (_specMod->getModifierType() == FTspectrumModifier::DB_MODIFIER) { // every 12 db float numDivs = ((_absmax - _absmin) / _gridFactor); float divdb = _gridFactor; int y; float cdb; for (int i=1; i < (int)numDivs; ++i) { cdb = _absmax - (divdb * i); if (cdb <= _max && cdb >= _min) { // add line y = (int) (( (cdb - _min) / (_max - _min)) * _height); _gridPoints.push_back (_height - y); //printf ("gain grid %d: %g y=%d\n", i, cdb, y); } } _maxstr = wxString::Format(wxT("%.1f"), _max); _minstr = wxString::Format(wxT("%.1f"), _min); } else if (_specMod->getModifierType() == FTspectrumModifier::RATIO_MODIFIER) { _maxstr = wxString::Format(wxT("%.0f"), _max); _minstr = wxString::Format(wxT("%.0f"), _min); } Refresh(FALSE); } void FTactiveBarGraph::updateSize() { GetClientSize(&_width, &_height); //printf ("ActiveBarGraph::OnSize: width=%d\n", _width); if (_width > 0 && _height > 0 ) { if (_backingMap) delete _backingMap; _backingMap = new wxBitmap(_width, _height); SetBackgroundColour(*wxBLACK); //Clear(); recalculate(); } } void FTactiveBarGraph::OnSize(wxSizeEvent & event) { updateSize(); event.Skip(); } void FTactiveBarGraph::writeExtra (FTspectrumModifier * specmod) { XMLNode * extra = specmod->getExtraNode(); extra->add_property ("xscale", static_cast (wxString::Format(wxT("%d"), _xScaleType).mb_str())); extra->add_property ("gridsnap", static_cast (wxString::Format(wxT("%d"), (int) _gridSnapFlag).mb_str())); extra->add_property ("grid", static_cast (wxString::Format(wxT("%d"), (int) _gridChoiceIndex).mb_str())); extra->add_property ("gridlines", static_cast (wxString::Format(wxT("%d"), (int) _gridFlag).mb_str())); } void FTactiveBarGraph::readExtra (FTspectrumModifier * specmod) { XMLNode * extra = specmod->getExtraNode(); XMLProperty * prop; long val; wxString strval; if ((prop = extra->property ("xscale"))) { strval = wxString::FromAscii (prop->value().c_str()); if (strval.ToLong (&val)) { setXscale ((XScaleType) val, false); } } if ((prop = extra->property ("grid"))) { strval = wxString::FromAscii (prop->value().c_str()); if (strval.ToLong (&val)) { setGridChoice ((unsigned int) val, false); } } if ((prop = extra->property ("gridsnap"))) { strval = wxString::FromAscii (prop->value().c_str()); if (strval.ToLong (&val)) { setGridSnap ( val != 0 ? true : false, false); } } if ((prop = extra->property ("gridlines"))) { strval = wxString::FromAscii (prop->value().c_str()); if (strval.ToLong (&val)) { setGridLines ( val != 0 ? true : false, false); } } } void FTactiveBarGraph::OnMouseActivity( wxMouseEvent &event) { if (!_specMod) { event.Skip(); return; } int pX = event.GetX(); int pY = event.GetY(); int i,j; //int length = _specMod->getLength(); //float xscale = (float) _width / (float)length; FTspectrumModifier *specm; if (_specMod) { specm = _specMod; } else if (_topSpecMod) { specm = _topSpecMod; } else { // nothing to do return; } if (event.LeftDown()) { if (event.RightIsDown()) { SetCursor(wxCURSOR_HAND); } else if (event.ControlDown() && event.ShiftDown() && event.AltDown() && !_dragging) { // ZOOMING SetCursor(wxCURSOR_MAGNIFIER); } if (!_mouseCaptured) { CaptureMouse(); _mouseCaptured = true; } } else if (event.RightDown()) { SetCursor(wxCURSOR_HAND); if (!_mouseCaptured) { CaptureMouse(); _mouseCaptured = true; } } if (event.Entering()) { SetCursor(wxCURSOR_PENCIL); updatePositionLabels(pX, pY, true); } else if (event.Leaving()) { SetCursor(*wxSTANDARD_CURSOR); _mainwin->updatePosition(wxT(""), wxT("")); } else if (event.MiddleUp()) { // popup scale menu this->PopupMenu ( _xscaleMenu, pX, pY); } else if (!_dragging && event.LeftIsDown() && (_zooming || (event.ControlDown() && event.ShiftDown() && event.AltDown()))) { // zooming related if (event.LeftDown()) { _zooming = true; if (_gridSnapFlag) { _firstY = _topzoomY = _bottomzoomY = valToY(snapValue(yToVal(_height - pY))) + 1; } else { _firstY = _topzoomY = _bottomzoomY = pY; } Refresh(FALSE); } else if (event.LeftIsDown()) { if (_gridSnapFlag) { if (pY < _firstY) { _bottomzoomY = _firstY; _topzoomY = valToY(snapValue(yToVal(_height - pY))) + 1; pY = _topzoomY + 1; } else { pY = valToY(snapValue(yToVal(_height - pY))); _bottomzoomY = valToY(snapValue(yToVal(_height - pY))) + 1; _topzoomY = _firstY; pY = _bottomzoomY; } } else { if (pY < _firstY) { _bottomzoomY = _firstY; _topzoomY = pY; } else { _bottomzoomY = pY; _topzoomY = _firstY; } } if (_topzoomY < 0) _topzoomY = 0; if (_bottomzoomY > _height) _bottomzoomY = _height; Refresh(FALSE); updatePositionLabels(pX, pY, true); } } else if ((event.LeftDown() || (_dragging && event.Dragging() && event.LeftIsDown())) && !event.RightIsDown() && !_zooming) { // Pencil drawing if (event.LeftDown()) { _firstX = _lastX = pX; _firstY = _lastY = pY; _dragging = true; } // modify spectrumModifier for bins float *values ; FTspectrumModifier *specmod=0; if (_topSpecMod) { if (event.ShiftDown() && _specMod) { // shift does regular specmod if there is a topspecmod values = _specMod->getValues(); specmod =_specMod; } else { values = _topSpecMod->getValues(); specmod = _topSpecMod; } } else if (_specMod) { values = _specMod->getValues(); specmod = _specMod; } else { event.Skip(); return; } int leftx, rightx; int sign, linesign = 0; if (_lastX <= pX) { leftx = _lastX; rightx = pX; sign = 1; } else { leftx = pX; rightx = _lastX; sign = -1; } // compute values to modify int frombin, tobin, fromi, toi; xToBinRange(leftx, fromi, toi); frombin = fromi; xToBinRange(rightx, fromi, toi); tobin = toi; //int fromi = (int) (_lastX / xscale); //int toi = (int) (pX / xscale); int useY = pY; if (event.ControlDown() && !event.AltDown()) { if (_firstCtrl) { _firstY = pY; _firstX = pX; _firstCtrl = false; } useY = _firstY; if (useY < 0) useY = 0; else if (useY > _height) useY = _height; float val = yToVal (useY); if (_gridSnapFlag) { val = snapValue(val); } for ( i=frombin; i<=tobin; i++) { values[i] = val; //values[i] = (((_height - useY) / (float)_height)) * (_max-_min) + _min; //printf ("i=%d values %g\n", i, values[i]); } } else { _firstCtrl = true; if (useY < 0) useY = 0; else if (useY > _height) useY = _height; if (event.ControlDown() && event.AltDown()) { if (_firstX <= pX) { leftx = _firstX; rightx = pX; linesign = 1; } else { leftx = pX; rightx = _firstX; linesign = -1; } } int leftY, rightY; if (sign != linesign) { if (sign > 0) { leftY = _lastY; rightY = useY; } else { leftY = useY; rightY = _lastY; } // if (specmod->getModifierType() != FTspectrumModifier::GAIN_MODIFIER) { float rightval = yToVal(rightY); float leftval = yToVal(leftY); if (_gridSnapFlag) { leftval = snapValue(leftval); rightval = snapValue(rightval); } float slope = (rightval - leftval) / (float)(1+tobin-frombin); int n = 0; if (_gridSnapFlag) { for ( i=frombin; i<=tobin; i++, n++) { values[i] = snapValue(leftval + slope * n); } } else { for ( i=frombin; i<=tobin; i++, n++) { values[i] = leftval + slope * n; } } } // else { // // do linear interpolation between firsty and usey // float slope = (rightY - leftY) / (float)(1+tobin-frombin); // //printf ("adjust is %g useY=%d lasty=%d\n", adj, useY, _lastY); // int n=0; // for ( i=frombin; i<=tobin; i++, n++) // { // values[i] = yToVal((int) (leftY + slope*n)); // } // } } if (event.ControlDown() && event.AltDown()) { xToBinRange(leftx, fromi, toi); frombin = fromi; xToBinRange(rightx, fromi, toi); tobin = toi; if (linesign > 0) { leftY = _firstY; rightY = useY; } else { leftY = useY; rightY = _firstY; } //if (specmod->getModifierType() != FTspectrumModifier::GAIN_MODIFIER) { float rightval = yToVal(rightY); float leftval = yToVal(leftY); if (_gridSnapFlag) { leftval = snapValue(leftval); rightval = snapValue(rightval); } float slope = (rightval - leftval) / (float)(1+tobin-frombin); int n = 0; if (_gridSnapFlag) { for ( i=frombin; i<=tobin; i++, n++) { values[i] = snapValue(leftval + slope * n); } } else { for ( i=frombin; i<=tobin; i++, n++) { values[i] = leftval + slope * n; } } } // else { // // do linear interpolation between firsty and usey // float slope = (rightY - leftY) / (float)(1+tobin-frombin); // //printf ("adjust is %g useY=%d lasty=%d\n", adj, useY, _lastY); // int n=0; // for ( i=frombin; i<=tobin; i++, n++) // { // values[i] = yToVal((int) (leftY + slope*n)); // } // } } } Refresh(FALSE); _mainwin->updateGraphs(this, specm->getSpecModifierType()); _lastX = pX; _lastY = useY; updatePositionLabels(pX, useY, true, specmod); } else if ((event.RightDown() || (_dragging && event.Dragging() && event.RightIsDown())) && !_zooming) { // shift entire contour around if (event.RightDown()) { _firstX = _lastX = pX; _firstY = _lastY = pY; SetCursor(wxCURSOR_HAND); _dragging = true; _firstMove = true; } float * valueslist[2]; FTspectrumModifier *specmod = _specMod; bool edgehold = event.ControlDown(); float *values; int totbins; if (_topSpecMod) { if (event.ShiftDown() && _specMod) { valueslist[0] = _specMod->getValues(); specmod = _specMod; totbins = _specMod->getLength(); valueslist[1] = 0; // do both if (event.LeftIsDown()) { valueslist[1] = _topSpecMod->getValues(); } } else { valueslist[0] = _topSpecMod->getValues(); specmod = _topSpecMod; totbins = _topSpecMod->getLength(); valueslist[1] = 0; // do both if (event.LeftIsDown()) { valueslist[1] = _specMod->getValues(); } } } else if (_specMod) { valueslist[0] = _specMod->getValues(); specmod = _specMod; totbins = _specMod->getLength(); valueslist[1] = 0; if (event.LeftIsDown() && _topSpecMod) { valueslist[1] = _topSpecMod->getValues(); } } else { event.Skip(); return; } if (_gridSnapFlag) { int fromi, toi; xToBinRange(_firstX, fromi, toi); if (_firstMove) { _lastVal = snapValue(valueslist[0][fromi]); _firstMove = false; } else { if (_lastY != pY) { float tval = valDiffY (_lastVal, _lastY, pY); if (tval == _lastVal) { // //printf ("not good enough returning: %g\n", tval); pY = _lastY; } else { _lastVal = tval; //printf ("good enough: new lastval=%g\n", _lastVal); } } } } // compute difference in x and y from last int diffX, diffY; diffX = pX - _lastX; diffY = pY - _lastY; int shiftbins = xDeltaToBinDelta (diffX); //float shiftval = yToVal(pY) - yToVal(_lastY); //printf ("shiftbins %d diffx %d diffy %d\n", shiftbins, diffX, diffY); for (int n = 0; n < 2 && valueslist[n]; n++) { values = valueslist[n]; if (shiftbins < 0) { // shiftbins is NEGATIVE shift left // store first shiftbins for (i=0; i < -shiftbins; i++) { _tmpfilt[i] = valDiffY (values[i], _lastY, pY); } for (i=0; i < totbins + shiftbins; i++) { values[i] = valDiffY (values[i-shiftbins], _lastY, pY); } // finish off with end if (edgehold) { for (i=totbins+shiftbins; i < totbins; i++) { values[i] = values[i-1]; } } else { for (j=0, i=totbins+shiftbins; i < totbins; i++, j++) { values[i] = _tmpfilt[j]; } } } else if (shiftbins > 0) { // shiftbins is POSITIVE, shift right // store last shiftbins for (i=totbins-shiftbins; i < totbins; i++) { _tmpfilt[i] = valDiffY (values[i], _lastY, pY); } for ( i=totbins-1; i >= shiftbins; i--) { values[i] = valDiffY (values[i-shiftbins], _lastY, pY); } // start off with first values (either wrapped or edge held) if (edgehold) { for ( i=shiftbins-1; i >= 0; i--) { values[i] = values[i+1]; } } else { for (j=totbins-shiftbins, i=0; i < shiftbins; i++, j++) { values[i] = _tmpfilt[j]; } } } else { // no bin shift just values for ( i=0; i < totbins; i++) { values[i] = valDiffY (values[i], _lastY, pY); } } } Refresh(FALSE); _mainwin->updateGraphs(this, specm->getSpecModifierType()); if (shiftbins != 0) { _lastX = pX; } _lastY = pY; updatePositionLabels(pX, pY, true, specmod); } else if (event.ButtonUp() && !event.LeftIsDown() && !event.RightIsDown()) { if (_mouseCaptured) { ReleaseMouse(); _mouseCaptured = false; } SetCursor(wxCURSOR_PENCIL); _dragging = false; if (event.RightUp() && event.ControlDown() && event.AltDown()) { if (event.ShiftDown()) { // reset zoom _zooming = false; if (_specMod->getModifierType() == FTspectrumModifier::GAIN_MODIFIER) { _mindb = _absmindb; _maxdb = _absmaxdb; _min = dbToVal(_mindb); _max = dbToVal(_maxdb); recalculate(); } else if (_specMod->getModifierType() == FTspectrumModifier::POS_GAIN_MODIFIER) { _mindb = _absposmindb; _maxdb = _absposmaxdb; _min = dbToVal(_mindb); _max = dbToVal(_maxdb); recalculate(); } else { setMinMax (_absmin, _absmax); } } else { // reset filter if (_specMod) { _specMod->reset(); } if (_topSpecMod) { _topSpecMod->reset(); } Refresh(FALSE); _mainwin->updateGraphs(this, specm->getSpecModifierType()); updatePositionLabels(pX, pY, true); } } else if (_zooming) { // commit zoom _zooming = false; if (_gridSnapFlag) { setMinMax ( snapValue(yToVal (_bottomzoomY)), snapValue(yToVal (_topzoomY)) ); } else { setMinMax ( yToVal (_bottomzoomY), yToVal (_topzoomY) ); } } event.Skip(); } else if (event.Moving()) { if (_topSpecMod && !event.ShiftDown()) { updatePositionLabels(pX, pY, true, _topSpecMod); } else if (_specMod) { updatePositionLabels(pX, pY, true, _specMod); } } else { event.Skip(); } } void FTactiveBarGraph::updatePositionLabels(int pX, int pY, bool showreal, FTspectrumModifier *specmod) { // calculate freq range and val for status bar float sfreq, efreq; int frombin, tobin; xToFreqRange(pX, sfreq, efreq, frombin, tobin); _freqstr.Printf (wxT("%5d - %5d Hz"), (int) sfreq, (int) efreq); float val, realval; if (!specmod) { if (_specMod) specmod = _specMod; else if (_topSpecMod) specmod = _topSpecMod; else return; } float *data = specmod->getValues(); if (specmod->getModifierType() == FTspectrumModifier::GAIN_MODIFIER ||specmod->getModifierType() == FTspectrumModifier::POS_GAIN_MODIFIER) { val = yToDb (pY); if (showreal) { realval = valToDb (data[frombin]); _valstr.Printf (wxT("C: %7.1f dB @: %7.1f dB"), val, realval); } else { _valstr.Printf (wxT("C: %7.1f dB"), val); } } else if (specmod->getModifierType() == FTspectrumModifier::SEMITONE_MODIFIER) { val = yToSemi (pY); if (showreal) { realval = valToSemi (data[frombin]); _valstr.Printf (wxT("C: %7.1f semi @: %7.1f semi"), val, realval); } else { _valstr.Printf (wxT("C: %7.1f dB"), val); } } else if (specmod->getModifierType() == FTspectrumModifier::TIME_MODIFIER) { val = yToVal (pY); if (showreal) { realval = data[frombin]; if (_gridChoiceIndex >= _beatscutoff) { _valstr.Printf (wxT("C: %7.3f beats @: %7.3f beats"), val * _tempo/60.0, realval * _tempo/60.0); } else { _valstr.Printf (wxT("C: %7.0f ms @: %7.0f ms"), val * 1000.0, realval * 1000.0); } } else { if (_gridChoiceIndex >= _beatscutoff) { _valstr.Printf (wxT("C: %7.3f beats"), val * _tempo/60.0); } else { _valstr.Printf (wxT("C: %7.0f ms"), val * 1000.0); } } } else if (specmod->getModifierType() == FTspectrumModifier::UNIFORM_MODIFIER) { val = yToVal (pY); if (showreal) { realval = data[frombin]; _valstr.Printf (wxT("C: %7.1f %% @: %7.1f %%"), val * 100.0, realval * 100.0); } else { _valstr.Printf (wxT("C: %7.1f %%"), val * 100.0); } } else if (specmod->getModifierType() == FTspectrumModifier::DB_MODIFIER) { val = yToVal (pY); if (showreal) { realval = data[frombin]; _valstr.Printf (wxT("C: %7.2f dB @: %7.2f dB"), val, realval); } else { _valstr.Printf (wxT("C: %8.2f dB"), val); } } else if (specmod->getModifierType() == FTspectrumModifier::FREQ_MODIFIER) { FTioSupport *iosup = FTioSupport::instance(); float samprate = (float) iosup->getSampleRate(); val = yToVal (pY); val = ((val - _absmin) / (_absmax-_absmin)) * samprate * 0.5; if (showreal) { realval = data[frombin]; realval = ((realval - _absmin) / (_absmax-_absmin)) * samprate * 0.5; _valstr.Printf (wxT("C: %5d Hz @: %5d Hz"), (int) val, (int) realval); } else { _valstr.Printf (wxT("C: %5d Hz"), (int)val); } } else { val = yToVal (pY); if (showreal) { realval = data[frombin]; _valstr.Printf (wxT("C: %7.3f @: %7.3f "), val, realval); } else { _valstr.Printf (wxT("C: %8.3f"), val); } } _mainwin->updatePosition ( _freqstr, _valstr ); } void FTactiveBarGraph::OnXscaleMenu (wxCommandEvent &event) { //wxMenuItem *item = (wxMenuItem *) event.GetEventObject(); if (event.GetId() == FT_1Xscale) { _xScaleType = XSCALE_1X; } else if (event.GetId() == FT_2Xscale) { _xScaleType = XSCALE_2X; } else if (event.GetId() == FT_LogaXscale) { _xScaleType = XSCALE_LOGA; } else if (event.GetId() == FT_LogbXscale) { _xScaleType = XSCALE_LOGB; } else { event.Skip(); } Refresh(FALSE); } freqtweak-0.7.2/src/FTactiveBarGraph.hpp0000644000175200017520000001405711226173741017124 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTACTIVEBARGRAPH_HPP__ #define __FTACTIVEBARGRAPH_HPP__ #include #include #include using namespace std; #include #include "FTtypes.hpp" #include "FTutils.hpp" #include "FTspectrumModifier.hpp" class FTmainwin; class FTactiveBarGraph : public wxPanel, public FTspectrumModifier::Listener { public: FTactiveBarGraph(FTmainwin *win, wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("ActiveBarGraph")); virtual ~FTactiveBarGraph(); void setSpectrumModifier (FTspectrumModifier *sm); FTspectrumModifier * getSpectrumModifier() { return _specMod; } void setTopSpectrumModifier (FTspectrumModifier *sm); FTspectrumModifier * getTopSpectrumModifier() { return _topSpecMod; } void setXscale(XScaleType sc, bool writeextra=true); XScaleType getXscale() { return _xScaleType; } bool setMinMax(float min, float max); void getMinMax(float &min, float &max) { min=_min; max=_max; } void setFixMin (bool flag); bool getFixMin () { return _fixMin; } void setGridLines (bool flag, bool writeextra=true); bool getGridLines() { return _gridFlag; } void setGridSnap (bool flag, bool writeextra=true); bool getGridSnap () { return _gridSnapFlag; } void OnPaint ( wxPaintEvent &event); void OnSize ( wxSizeEvent &event); void OnMouseActivity ( wxMouseEvent &event ); void OnXscaleMenu (wxCommandEvent &event); void setBypassed (bool flag) { _bypassed = flag; Refresh(FALSE);} bool getBypassed () { return _bypassed; } const vector & getGridChoiceStrings() { return _gridChoices; } void setGridChoice (unsigned int , bool writeextra=true); unsigned int getGridChoice () { return _gridChoiceIndex; } void setTempo(int bpm); int getTempo() { return _tempo; } // listener void goingAway (FTspectrumModifier * specmod); void refreshBounds(); void recalculate(); void writeExtra(FTspectrumModifier * sp); void readExtra(FTspectrumModifier * sp); protected: void updateSize(); void xToBinRange(int x, int &frombin, int &tobin); void binToXRange(int bin, int &fromx, int &tox); int xDeltaToBinDelta(int xdelt); void xToFreqRange(int x, float &fromfreq, float &tofreq, int &frombin, int &tobin); int valToY(float val); float yToVal(int y); inline float valToDb(float val); inline float dbToVal(float db); inline float valToSemi(float val); inline float semiToVal(float semi); float yToDb(int y); float yToSemi(int y); float valDiffY(float val, int lasty, int newy); void updatePositionLabels(int pX, int pY, bool showreal=false, FTspectrumModifier *specmod=0); void paintGridlines(wxDC & dc); float snapValue(float val); void makeGridChoices(bool setdefault=false); int _width, _height; int _plotWidth, _plotHeight; int _leftWidth; int _topHeight; int _rightWidth; int _bottomHeight; FTspectrumModifier * _specMod; FTspectrumModifier * _topSpecMod; float _min, _max; float _absmin, _absmax; float _xscale; float _mindb, _maxdb; float _absmindb, _absmaxdb; float _absposmindb, _absposmaxdb; float _minsemi, _maxsemi; float _absminsemi, _absmaxsemi; float *_tmpfilt, *_toptmpfilt; wxColour _barColor0,_barColor1; wxColour _barColor2,_barColor3, _barColorDead, _tipColor; wxBrush _barBrush0, _barBrush1, _barBrush2, _barBrush3, _barBrushDead ,_tipBrush; wxBrush _bypassBrush; wxBrush _bgBrush; wxColour _penColor; wxPen _barPen; wxColour _gridColor; wxPen _gridPen; wxBitmap * _backingMap; XScaleType _xScaleType; bool _fixMin; YScaleType _yScaleType; // mouse stuff int _lastX, _lastY; int _firstX, _firstY; float _lastVal; bool _dragging; bool _firstCtrl, _firstMove; bool _zooming; int _topzoomY, _bottomzoomY; wxString _freqstr, _valstr; wxMenu * _xscaleMenu; FTmainwin * _mainwin; list _gridPoints; bool _gridFlag; bool _gridSnapFlag; bool _mouseCaptured; bool _bypassed; vector _gridChoices; vector _gridValues; float _gridFactor; unsigned int _gridChoiceIndex; wxFont _boundsFont; wxColour _textColor; FTspectrumModifier::ModifierType _mtype; wxString _maxstr, _minstr; // tempo for time only int _tempo; unsigned int _beatscutoff; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; inline float FTactiveBarGraph::valToDb(float val) { // assumes 0 <= yval <= 1 if (val <= 0.0) { // negative infinity really return -200.0; } //float nval = (20.0 * FTutils::fast_log10(yval / refmax)); float nval = (20.0 * FTutils::fast_log10(val)); // printf ("scaled value is %g mincut=%g\n", nval, _minCutoff); return nval; } inline float FTactiveBarGraph::dbToVal(float db) { //float nval = (20.0 * FTutils::fast_log10(yval / refmax)); float nval = pow ( (float)10.0, db/20); // printf ("scaled value is %g mincut=%g\n", nval, _minCutoff); return nval; } inline float FTactiveBarGraph::semiToVal(float semi) { float val = pow (2.0, semi/12.0); // printf ("scaled value is %g mincut=%g\n", nval, _minCutoff); return val; } inline float FTactiveBarGraph::valToSemi(float val) { // assumes 0 <= yval <= 1 if (val <= 0.0) { // invalid return 0.0; } float semi = 12.0 * FTutils::fast_log2(val); return semi; } #endif freqtweak-0.7.2/src/FTpresetBlendDialog.cpp0000644000175200017520000002564011226173741017624 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include using namespace std; #include #include #include "FTpresetBlendDialog.hpp" #include "FTioSupport.hpp" #include "FTmainwin.hpp" #include "FTdspManager.hpp" #include "FTprocI.hpp" #include "FTprocessPath.hpp" #include "FTspectralEngine.hpp" #include "FTpresetBlender.hpp" enum { ID_PriPresetCombo=2000, ID_SecPresetCombo, ID_MasterSlider, ID_FilterBlendSlider }; BEGIN_EVENT_TABLE(FTpresetBlendDialog, wxFrame) EVT_CLOSE(FTpresetBlendDialog::onClose) EVT_SIZE (FTpresetBlendDialog::onSize) EVT_PAINT (FTpresetBlendDialog::onPaint) EVT_COMMAND_SCROLL (ID_MasterSlider, FTpresetBlendDialog::onSliders) EVT_COMMAND_SCROLL (ID_FilterBlendSlider, FTpresetBlendDialog::onSliders) EVT_COMBOBOX (ID_PriPresetCombo, FTpresetBlendDialog::onCombo) EVT_COMBOBOX (ID_SecPresetCombo, FTpresetBlendDialog::onCombo) END_EVENT_TABLE() FTpresetBlendDialog::FTpresetBlendDialog(FTmainwin * parent, FTconfigManager *confman, wxWindowID id, const wxString & title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxFrame(parent, id, title, pos, size, style, name), _mainwin(parent), _justResized(false), _namewidth(85), _configMan(confman) { _presetBlender = new FTpresetBlender(_configMan); init(); } FTpresetBlendDialog::~FTpresetBlendDialog() { delete _presetBlender; } void FTpresetBlendDialog::onSize(wxSizeEvent &ev) { _justResized = true; ev.Skip(); } void FTpresetBlendDialog::onPaint(wxPaintEvent &ev) { if (_justResized) { _justResized = false; } ev.Skip(); } void FTpresetBlendDialog::init() { wxBoxSizer * mainsizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *tmpsizer, *tmpsizer2; wxStaticText * stattext; wxBoxSizer * comboSizer = new wxBoxSizer(wxHORIZONTAL); tmpsizer = new wxBoxSizer(wxVERTICAL); tmpsizer2 = new wxBoxSizer(wxHORIZONTAL); stattext = new wxStaticText(this, -1, wxT("Preset 1: "), wxDefaultPosition, wxSize(-1, -1)); //stattext->SetFont(titleFont); tmpsizer2->Add(stattext, 0, wxALL|wxEXPAND, 1); _priStatus = new wxStaticText(this, -1, wxT("not set"), wxDefaultPosition, wxSize(-1, -1)); tmpsizer2->Add(_priStatus, 0, wxALL, 1); tmpsizer->Add (tmpsizer2, 0, wxALL|wxEXPAND, 1); _priPresetBox = new wxComboBox (this, ID_PriPresetCombo, wxT(""), wxDefaultPosition, wxSize(175,-1), 0, 0, wxCB_READONLY|wxCB_SORT); tmpsizer->Add( _priPresetBox, 0, wxALL|wxEXPAND|wxALIGN_LEFT, 1); comboSizer->Add( tmpsizer, 0, wxALL|wxALIGN_LEFT, 1); comboSizer->Add(1,-1,1); tmpsizer = new wxBoxSizer(wxVERTICAL); tmpsizer2 = new wxBoxSizer(wxHORIZONTAL); stattext = new wxStaticText(this, -1, wxT("Preset 2: "), wxDefaultPosition, wxSize(-1, -1)); //stattext->SetFont(titleFont); tmpsizer2->Add(stattext, 0, wxALL|wxEXPAND, 1); _secStatus = new wxStaticText(this, -1, wxT("not set"), wxDefaultPosition, wxSize(-1, -1)); tmpsizer2->Add(_secStatus, 0, wxALL|wxEXPAND, 1); tmpsizer->Add (tmpsizer2, 0, wxALL|wxEXPAND, 1); _secPresetBox = new wxComboBox (this, ID_SecPresetCombo, wxT(""), wxDefaultPosition, wxSize(175,-1), 0, 0, wxCB_READONLY|wxCB_SORT); tmpsizer->Add( _secPresetBox, 0, wxALL|wxEXPAND|wxALIGN_LEFT, 1); comboSizer->Add( tmpsizer, 0, wxALL|wxALIGN_LEFT, 1); mainsizer->Add (comboSizer, 0, wxEXPAND|wxALL, 2); tmpsizer = new wxBoxSizer(wxHORIZONTAL); stattext = new wxStaticText(this, -1, wxT("Master"), wxDefaultPosition, wxSize(_namewidth, -1)); //stattext->SetFont(titleFont); stattext->SetSize(_namewidth, -1); tmpsizer->Add (stattext, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 1); _masterBlend = new wxSlider(this, ID_MasterSlider, 0, 0, 1000); tmpsizer->Add (_masterBlend, 1, wxALL|wxALIGN_CENTRE_VERTICAL, 3); mainsizer->Add (tmpsizer, 0, wxEXPAND|wxALL, 5); mainsizer->Add (2,5); //wxScrolledWindow * scrolled = new wxScrolledWindow(this, -1); _procSizer = new wxBoxSizer(wxVERTICAL); wxScrolledWindow *scrolled = new wxScrolledWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxSUNKEN_BORDER); scrolled->SetScrollRate (0,20); _procPanel = scrolled; refreshState(); _procPanel->SetAutoLayout( TRUE ); _procSizer->Fit( _procPanel ); _procSizer->SetSizeHints( this ); _procPanel->SetSizer( _procSizer ); mainsizer->Add (_procPanel, 1, wxEXPAND|wxALL, 2); SetAutoLayout( TRUE ); mainsizer->Fit( this ); mainsizer->SetSizeHints( this ); SetSizer( mainsizer ); this->SetSizeHints(400,100); } void FTpresetBlendDialog::refreshState(const wxString & defname, bool usefirst, const wxString & defsec, bool usesec) { //wxFont titleFont(12, wxDEFAULT, wxNORMAL, wxBOLD); // not compatible with old wx _procSizer->Clear (true); _procSizer->Layout(); _blendSliders.clear(); _blendPairs.clear(); _filtRefs.clear(); // reload presets list presetlist = _mainwin->getConfigManager().getSettingsNames(); wxString origfirst = _priPresetBox->GetValue(); wxString origsec = _secPresetBox->GetValue(); _priPresetBox->Clear(); _secPresetBox->Clear(); for (list::iterator name=presetlist.begin(); name != presetlist.end(); ++name) { _priPresetBox->Append(wxString::FromAscii ((*name).c_str())); _secPresetBox->Append(wxString::FromAscii ((*name).c_str())); } _priPresetBox->SetValue(defname.c_str()); _secPresetBox->SetValue(defsec.c_str()); // get configured modules from the first procpath FTprocessPath * procpath = FTioSupport::instance()->getProcessPath(0); if (procpath) { FTspectralEngine *engine = procpath->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); for (unsigned int n=0; n < procmods.size(); ++n) { // item.SetText (procmods[n]->getName().c_str()); // item.SetData ((unsigned) procmods[n]); // item.SetId (n); // _targetList->InsertItem(item); FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); for (unsigned int m=0; m < filts.size(); ++m) { wxBoxSizer * tmpsizer = new wxBoxSizer(wxHORIZONTAL); wxStaticText * stattext = new wxStaticText(_procPanel, -1, wxString::FromAscii (filts[m]->getName().c_str()), wxDefaultPosition, wxSize(_namewidth, -1)); //stattext->SetFont(titleFont); stattext->SetSize(_namewidth, -1); tmpsizer->Add (stattext, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 1); wxSlider * slid = new wxSlider(_procPanel, ID_FilterBlendSlider, 0, 0, 1000); tmpsizer->Add (slid, 1, wxALL|wxALIGN_CENTRE_VERTICAL, 1); _blendSliders.push_back (slid); _blendPairs.push_back (ProcPair(n, m)); _filtRefs.push_back (filts[m]); _procSizer->Add (tmpsizer, 0, wxEXPAND|wxALL, 4); } } } _procSizer->Layout(); // try to load them up if (usefirst) { if (_presetBlender->setPreset (static_cast (defname.mb_str()), 0)) { _priPresetBox->SetValue (wxString(defname.c_str())); _priStatus->SetLabel (wxT("ready")); } else { _priStatus->SetLabel (wxT("not set or invalid")); } } else { if (_presetBlender->setPreset (static_cast (origfirst.mb_str()), 0)) { _priPresetBox->SetValue (origfirst); _priStatus->SetLabel (wxT("ready")); } else { _priStatus->SetLabel (wxT("not set or invalid")); } } if (usesec) { if (_presetBlender->setPreset (static_cast (defsec.mb_str()), 1)) { _secPresetBox->SetValue (wxString(defsec.c_str())); _secStatus->SetLabel (wxT("ready")); } else { _secStatus->SetLabel (wxT("not set or invalid")); } } else { if (_presetBlender->setPreset (static_cast (origsec.mb_str()), 1)) { _secPresetBox->SetValue (origsec); _secStatus->SetLabel (wxT("ready")); } else { _secStatus->SetLabel (wxT("not set or invalid")); } } } void FTpresetBlendDialog::onClose(wxCloseEvent & ev) { if (!ev.CanVeto()) { Destroy(); } else { ev.Veto(); Show(false); } } void FTpresetBlendDialog::onCombo(wxCommandEvent &ev) { if (ev.GetId() == ID_PriPresetCombo) { wxString name = _priPresetBox->GetStringSelection(); if (!name.empty()) { if (!_presetBlender->setPreset(static_cast (name.mb_str()), 0)) { // display error message printf ("error could not load preset %s\n", static_cast (name.mb_str())); _priPresetBox->SetSelection(-1); _priPresetBox->SetValue(wxT("")); _priStatus->SetLabel (wxT("not set or invalid")); } else { _priStatus->SetLabel (wxT("ready")); } } } else if (ev.GetId() == ID_SecPresetCombo) { wxString name = _secPresetBox->GetStringSelection(); if (!name.empty()) { if (!_presetBlender->setPreset(static_cast (name.mb_str()), 1)) { // display error message printf ("error could not load preset %s\n", static_cast (name.mb_str())); _secPresetBox->SetSelection(-1); _secPresetBox->SetValue(wxT("")); _secStatus->SetLabel (wxT("not set or invalid")); } else { _secStatus->SetLabel (wxT("ready")); } } } } void FTpresetBlendDialog::onSliders(wxScrollEvent &ev) { wxSlider * source = (wxSlider *) ev.GetEventObject(); bool updateall = false; static bool ignoreevent = false; if (ignoreevent) return; for (unsigned int i=0; i < _blendSliders.size(); ++i) { if (_masterBlend == source) { ProcPair & ppair = _blendPairs[i]; float max = (float) _masterBlend->GetMax(); float min = (float) _masterBlend->GetMin(); float newval = (((float)_masterBlend->GetValue() - min) / (max-min)); _presetBlender->setBlend (ppair.first, ppair.second, 1.0 - newval); ignoreevent = true; _blendSliders[i]->SetValue(_masterBlend->GetValue()); updateall = true; } else if (_blendSliders[i] == source) { ProcPair & ppair = _blendPairs[i]; float max = (float) _blendSliders[i]->GetMax(); float min = (float) _blendSliders[i]->GetMin(); float newval = ((_blendSliders[i]->GetValue() - min) / (max-min)); _presetBlender->setBlend (ppair.first, ppair.second, 1.0 - newval); _mainwin->updateGraphs(0, _filtRefs[i]->getSpecModifierType()); break; } } if (updateall) { _mainwin->updateGraphs(0, ALL_SPECMOD); if (ignoreevent) { ignoreevent = false; } } } freqtweak-0.7.2/src/FTpresetBlendDialog.hpp0000644000175200017520000000455311226173741017631 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPRESETBLENDDIALOG_HPP__ #define __FTPRESETBLENDDIALOG_HPP__ #include #include "FTtypes.hpp" #include #include using namespace std; class FTmainwin; class FTconfigManager; class FTpresetBlender; class FTspectrumModifier; class FTpresetBlendDialog : public wxFrame { public: FTpresetBlendDialog(FTmainwin * parent, FTconfigManager * confman, wxWindowID id, const wxString & title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(400,600), long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("PresetBlend")); virtual ~FTpresetBlendDialog(); void update(); void refreshState(const wxString & defname = wxT(""), bool usefirst=false, const wxString & defsec = wxT(""), bool usesec=false); protected: void init(); void onClose(wxCloseEvent & ev); void onSize(wxSizeEvent &ev); void onPaint(wxPaintEvent &ev); void onSliders(wxScrollEvent &ev); void onCombo(wxCommandEvent &ev); wxBoxSizer * _procSizer; wxWindow * _procPanel; wxComboBox * _priPresetBox; wxComboBox * _secPresetBox; wxStaticText * _priStatus; wxStaticText * _secStatus; wxSlider * _masterBlend; vector _blendSliders; typedef pair ProcPair; vector _blendPairs; vector _filtRefs; FTmainwin * _mainwin; bool _justResized; int _namewidth; FTconfigManager * _configMan; FTpresetBlender * _presetBlender; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; #endif freqtweak-0.7.2/src/version.h.in0000644000175200017520000000024311226173741015532 0ustar develdevel#ifndef __freqtweak_version_h__ #define __freqtweak_version_h__ static const char *freqtweak_version = "@FREQTWEAK_VERSION@"; #endif // __freqtweak_version_h__ freqtweak-0.7.2/src/FTprocLimit.cpp0000644000175200017520000000506711226173741016200 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTprocLimit.hpp" #include "FTutils.hpp" #include using namespace std; FTprocLimit::FTprocLimit (nframes_t samprate, unsigned int fftn) : FTprocI("Limit", samprate, fftn) , _dbAdjust(-48.0) { _confname = "Limit"; } FTprocLimit::FTprocLimit (const FTprocLimit & other) : FTprocI (other._name, other._sampleRate, other._fftN) , _dbAdjust(-48.0) { _confname = "Limit"; } void FTprocLimit::initialize() { // create filter _threshfilter = new FTspectrumModifier("Limit", "limit_thresh", 0, FTspectrumModifier::DB_MODIFIER, MASH_SPECMOD, _fftN/2, 0.0); _threshfilter->setRange(-90.0, 0.0); _filterlist.push_back (_threshfilter); _inited = true; } FTprocLimit::~FTprocLimit() { if (!_inited) return; _filterlist.clear(); delete _threshfilter; } void FTprocLimit::process (fft_data *data, unsigned int fftn) { if (!_inited || _threshfilter->getBypassed()) { return; } float *filter = _threshfilter->getValues(); float min = _threshfilter->getMin(); float max = _threshfilter->getMax(); float filt; float power; float db; float scale; int fftN2 = (fftn+1) >> 1; // do for first element filt = FTutils::f_clamp (filter[0], min, max); power = (data[0] * data[0]); db = FTutils::powerLogScale (power, 0.0000000) + _dbAdjust; // total fudge factors if (filt < db) { // apply limiting scale = 1 / (pow (2, (db-filt) / 6.0)); data[0] *= scale; } // do for the rest for (int i = 1; i < fftN2-1; i++) { filt = FTutils::f_clamp (filter[i], min, max); power = (data[i] * data[i]) + (data[fftn-i] * data[fftn-i]); db = FTutils::powerLogScale (power, 0.0000000) + _dbAdjust; // total fudge factors if (filt < db) { // apply limiting scale = 1 / (pow (2, (db-filt) / 6.0)); data[i] *= scale; data[fftn-i] *= scale; } } } freqtweak-0.7.2/src/FTprocLimit.hpp0000644000175200017520000000242411226173741016177 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPROCLIMIT_HPP__ #define __FTPROCLIMIT_HPP__ #include "FTprocI.hpp" class FTprocLimit : public FTprocI { public: FTprocLimit(nframes_t samprate, unsigned int fftn); FTprocLimit (const FTprocLimit & other); virtual ~FTprocLimit(); FTprocI * clone() { return new FTprocLimit(*this); } void initialize(); void process (fft_data *data, unsigned int fftn); virtual bool useAsDefault() { return false; } protected: FTspectrumModifier * _threshfilter; float _dbAdjust; }; #endif freqtweak-0.7.2/src/FTdspManager.cpp0000644000175200017520000000542111226173741016311 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTdspManager.hpp" #include "FTioSupport.hpp" #include "FTprocI.hpp" #include "FTprocEQ.hpp" #include "FTprocGate.hpp" #include "FTprocDelay.hpp" #include "FTprocPitch.hpp" #include "FTprocLimit.hpp" #include "FTprocWarp.hpp" #include "FTprocCompressor.hpp" #include "FTprocBoost.hpp" FTdspManager * FTdspManager::_instance = 0; FTdspManager::FTdspManager() { unsigned int fftn = 512; nframes_t samprate = FTioSupport::instance()->getSampleRate(); // TODO: load initial dynamically FTprocI * procmod = new FTprocEQ (samprate, fftn); _prototypes.push_back (procmod); procmod = new FTprocBoost (samprate, fftn); _prototypes.push_back (procmod); procmod = new FTprocPitch (samprate, fftn); _prototypes.push_back (procmod); procmod = new FTprocGate (samprate, fftn); _prototypes.push_back (procmod); procmod = new FTprocDelay (samprate, fftn); _prototypes.push_back (procmod); procmod = new FTprocLimit (samprate, fftn); _prototypes.push_back (procmod); procmod = new FTprocWarp (samprate, fftn); _prototypes.push_back (procmod); procmod = new FTprocCompressor (samprate, fftn); _prototypes.push_back (procmod); } FTdspManager::~FTdspManager() { // cleanup prototypes for (ModuleList::iterator iter = _prototypes.begin(); iter != _prototypes.end(); ++iter) { delete (*iter); } _prototypes.clear(); } void FTdspManager::getAvailableModules (ModuleList & outlist) { outlist.clear(); for (ModuleList::iterator iter = _prototypes.begin(); iter != _prototypes.end(); ++iter) { outlist.push_back(*iter); } } FTprocI * FTdspManager::getModuleByName (const string & name) { for (ModuleList::iterator iter = _prototypes.begin(); iter != _prototypes.end(); ++iter) { if ((*iter)->getName() == name) { return (*iter); } } return 0; } FTprocI * FTdspManager::getModuleByConfigName (const string & name) { for (ModuleList::iterator iter = _prototypes.begin(); iter != _prototypes.end(); ++iter) { if ((*iter)->getConfName() == name) { return (*iter); } } return 0; } freqtweak-0.7.2/src/FTdspManager.hpp0000644000175200017520000000260211226173741016314 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTDSPMANAGER_HPP__ #define __FTDSPMANAGER_HPP__ #include "FTtypes.hpp" #include #include using namespace std; class FTprocI; class FTdspManager { public: typedef list ModuleList; FTdspManager(); virtual ~FTdspManager(); static FTdspManager * instance() { if (!_instance) _instance = new FTdspManager(); return _instance; } void getAvailableModules (ModuleList & outlist); FTprocI * getModuleByName (const string & name); FTprocI * getModuleByConfigName (const string & name); protected: ModuleList _prototypes; static FTdspManager* _instance; }; #endif freqtweak-0.7.2/src/FTprocEQ.cpp0000644000175200017520000000357711226173741015433 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTprocEQ.hpp" #include "FTutils.hpp" FTprocEQ::FTprocEQ (nframes_t samprate, unsigned int fftn) : FTprocI("EQ Cut", samprate, fftn) { _confname = "EQ"; } FTprocEQ::FTprocEQ (const FTprocEQ & other) : FTprocI (other._name, other._sampleRate, other._fftN) { _confname = "EQ"; } void FTprocEQ::initialize() { // create filter _eqfilter = new FTspectrumModifier("EQ Cut", "freq", 0, FTspectrumModifier::GAIN_MODIFIER, FREQ_SPECMOD, _fftN/2, 1.0); _eqfilter->setRange(0.0, 1.0); _filterlist.push_back (_eqfilter); _inited = true; } FTprocEQ::~FTprocEQ() { if (!_inited) return; _filterlist.clear(); delete _eqfilter; } void FTprocEQ::process (fft_data *data, unsigned int fftn) { if (!_inited || _eqfilter->getBypassed()) { return; } float *filter = _eqfilter->getValues(); float min = _eqfilter->getMin(); float max = _eqfilter->getMax(); float filt; int fftN2 = fftn/2; filt = FTutils::f_clamp (filter[0], min, max); data[0] *= filt; for (int i = 1; i < fftN2-1; i++) { filt = FTutils::f_clamp (filter[i], min, max); data[i] *= filt; data[fftn-i] *= filt; } } freqtweak-0.7.2/src/FTprocEQ.hpp0000644000175200017520000000227011226173741015425 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPROCEQ_HPP__ #define __FTPROCEQ_HPP__ #include "FTprocI.hpp" class FTprocEQ : public FTprocI { public: FTprocEQ(nframes_t samprate, unsigned int fftn); FTprocEQ (const FTprocEQ & other); virtual ~FTprocEQ(); FTprocI * clone() { return new FTprocEQ(*this); } void initialize(); void process (fft_data *data, unsigned int fftn); protected: FTspectrumModifier * _eqfilter; }; #endif freqtweak-0.7.2/src/FTioSupport.cpp0000644000175200017520000000255611226173741016242 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include #include using namespace std; #include "FTioSupport.hpp" #include "FTjackSupport.hpp" FTioSupport * FTioSupport::_instance = 0; FTioSupport::IOtype FTioSupport::_iotype = FTioSupport::IO_JACK; string FTioSupport::_defaultName; string FTioSupport::_defaultServ; FTioSupport * FTioSupport::createInstance() { // static method if (_iotype == IO_JACK) { return new FTjackSupport(_defaultName.c_str(), _defaultServ.c_str()); } else { return 0; } } void FTioSupport::setName (const string & name) { _name = name; } freqtweak-0.7.2/src/FTioSupport.hpp0000644000175200017520000000633211226173741016243 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ /** * Supports operations concerning I/O with JACK */ #ifndef __FTIOSUPPORT_HPP__ #define __FTIOSUPPORT_HPP__ #include using namespace std; #include "FTtypes.hpp" class FTprocessPath; class FTioSupport { public: virtual ~FTioSupport() {}; virtual bool init() = 0; virtual bool reinit(bool rebuild=true) = 0; virtual bool isInited() = 0; //virtual bool setProcessPath(FTprocessPath *ppath, int index) = 0; virtual FTprocessPath * getProcessPath(int index) = 0; virtual FTprocessPath * setProcessPathActive(int index, bool flag) = 0; virtual int getActivePathCount () = 0; virtual bool startProcessing() = 0; virtual bool stopProcessing() = 0; virtual bool close() = 0; virtual bool connectPathInput (int index, const char *inname) = 0; virtual bool connectPathOutput (int index, const char *outname) = 0; virtual bool disconnectPathInput (int index, const char *inname) = 0; virtual bool disconnectPathOutput (int index, const char *outname) = 0; virtual const char ** getConnectedInputPorts(int index) = 0; virtual const char ** getConnectedOutputPorts(int index) = 0; virtual const char ** getInputConnectablePorts(int index) = 0; virtual const char ** getOutputConnectablePorts(int index) = 0; virtual const char * getInputPortName(int index) = 0; virtual const char * getOutputPortName(int index) = 0; virtual const char ** getPhysicalInputPorts() = 0; virtual const char ** getPhysicalOutputPorts() = 0; virtual nframes_t getSampleRate() = 0; virtual nframes_t getTransportFrame() = 0; virtual bool getPortsChanged() = 0; virtual void setName (const string & name); virtual const char * getName() { return _name.c_str(); } virtual bool inAudioThread() { return false; } virtual void setProcessingBypassed (bool val) = 0; enum IOtype { IO_JACK, }; // set io type for this session // call before the first instance is called static void setIOtype (IOtype it) { _iotype = it; } // singleton retrieval static FTioSupport * instance() { if (!_instance) _instance = createInstance(); return _instance; } static void setDefaultName(const string & name) { _defaultName = name; } static void setDefaultServer(const string & dir) { _defaultServ = dir; } protected: // this is our singleton static FTioSupport * _instance; static IOtype _iotype; static FTioSupport * createInstance(); static string _defaultName; static string _defaultServ; string _name; }; #endif freqtweak-0.7.2/src/ftlogo.xpm0000644000175200017520000004266611226173741015326 0ustar develdevel/* XPM */ static char * ftlogo_xpm[] = { "70 40 752 2", " c None", ". c #D6D6D6", "+ c #BBBBBB", "@ c #8B8B8B", "# c #B0B0B0", "$ c #C3C3C3", "% c #4C4D4C", "& c #0D130D", "* c #0F190F", "= c #727272", "- c #C9C9C9", "; c #222522", "> c #142114", ", c #666D0B", "' c #5E6408", ") c #545554", "! c #1B2712", "~ c #677625", "{ c #53849C", "] c #6B9484", "^ c #CACACA", "/ c #121812", "( c #394B24", "_ c #5A8B98", ": c #447493", "< c #27383F", "[ c #848484", "} c #CECECE", "| c #959595", "1 c #7A7A7A", "2 c #D1D1D1", "3 c #D2D2D2", "4 c #A3A3A3", "5 c #797979", "6 c #717171", "7 c #909090", "8 c #C7C7C7", "9 c #A1A1A1", "0 c #737373", "a c #969696", "b c #CCCCCC", "c c #AEAEAE", "d c #0E170D", "e c #496349", "f c #548BAC", "g c #253942", "h c #BABABA", "i c #B3B3B3", "j c #212321", "k c #152315", "l c #0E150E", "m c #C6C6C6", "n c #B4B4B4", "o c #2D2F2D", "p c #0D160D", "q c #101B10", "r c #151A15", "s c #838383", "t c #ADADAD", "u c #2A2C2A", "v c #1C1F1C", "w c #AAAAAA", "x c #172110", "y c #6B9892", "z c #343E43", "A c #C8C8C8", "B c #1C1E1C", "C c #172717", "D c #192919", "E c #0F170F", "F c #B5B5B5", "G c #172617", "H c #182818", "I c #182918", "J c #0E170E", "K c #7C7C7C", "L c #B1B1B1", "M c #1B1E11", "N c #223015", "O c #1D2E18", "P c #0C140C", "Q c #898989", "R c #47562E", "S c #6199B7", "T c #305164", "U c #2A3D46", "V c #7A7A79", "W c #121E11", "X c #263516", "Y c #1A210D", "Z c #383A38", "` c #162616", " . c #142214", ".. c #212421", "+. c #444544", "@. c #0F160F", "#. c #243416", "$. c #26290E", "%. c #C2C2C2", "&. c #D3D3D3", "*. c #30363A", "=. c #789354", "-. c #7C954E", ";. c #89941F", ">. c #1A2715", ",. c #141814", "'. c #25445E", "). c #4C82A6", "!. c #52839D", "~. c #4F5049", "{. c #64752E", "]. c #243316", "^. c #37390C", "/. c #414137", "(. c #A6A6A6", "_. c #323506", ":. c #3D4912", "<. c #161A16", "[. c #B8B8B8", "}. c #545454", "|. c #182614", "1. c #536833", "2. c #43666E", "3. c #7A7B7B", "4. c #ACACAC", "5. c #294456", "6. c #5B92B2", "7. c #4A80A4", "8. c #3D5A5E", "9. c #585855", "0. c #686868", "a. c #0F150F", "b. c #8D8D8D", "c. c #42494C", "d. c #779D7A", "e. c #7F8713", "f. c #545B11", "g. c #858585", "h. c #445F54", "i. c #82A164", "j. c #767E11", "k. c #4E4E45", "l. c #646464", "m. c #121C0E", "n. c #738023", "o. c #5E8A88", "p. c #467798", "q. c #575859", "r. c #436C83", "s. c #477A9C", "t. c #404447", "u. c #D7D7D7", "v. c #D8D8D8", "w. c #5E5E5E", "x. c #152415", "y. c #162516", "z. c #666666", "A. c #3D6884", "B. c #345363", "C. c #538AAC", "D. c #4D82A7", "E. c #446A7C", "F. c #A0A0A0", "G. c #8F8F8F", "H. c #325772", "I. c #5E97B5", "J. c #558AA8", "K. c #42474B", "L. c #353835", "M. c #424333", "N. c #41494D", "O. c #3F484D", "P. c #3D454C", "Q. c #777777", "R. c #878787", "S. c #436D83", "T. c #487B9D", "U. c #3D4145", "V. c #7F7F7F", "W. c #5A5A5A", "X. c #303B42", "Y. c #A5A5A5", "Z. c #C0C0C0", "`. c #AFAFAF", " + c #1E374C", ".+ c #588FB0", "++ c #233540", "@+ c #B2B2B2", "#+ c #D4D4D4", "$+ c #ABABAB", "%+ c #3B5D6F", "&+ c #4E4F4F", "*+ c #5B5B5B", "=+ c #70706F", "-+ c #1D2A16", ";+ c #384248", ">+ c #2F3439", ",+ c #598DAA", "'+ c #47789A", ")+ c #293D48", "!+ c #27363F", "~+ c #1F2D34", "{+ c #2F3539", "]+ c #5388A6", "^+ c #5B93B2", "/+ c #5386A2", "(+ c #263E4C", "_+ c #6C6C6B", ":+ c #747E21", "<+ c #636C10", "[+ c #1C2C17", "}+ c #A8A8A8", "|+ c #233541", "1+ c #5186A5", "2+ c #5E97B6", "3+ c #578EAF", "4+ c #47789B", "5+ c #2C373B", "6+ c #C1C1C1", "7+ c #20303B", "8+ c #46779A", "9+ c #2D4958", "0+ c #6C6C6C", "a+ c #45718C", "b+ c #69907A", "c+ c #818E23", "d+ c #1B3245", "e+ c #487288", "f+ c #3E6780", "g+ c #373E42", "h+ c #3F4548", "i+ c #3E667F", "j+ c #39617C", "k+ c #324F5C", "l+ c #252E35", "m+ c #2C4C63", "n+ c #50819B", "o+ c #4E7F9B", "p+ c #355A73", "q+ c #222F35", "r+ c #282F36", "s+ c #36586B", "t+ c #4D7E99", "u+ c #294251", "v+ c #5B91B0", "w+ c #9E9E9E", "x+ c #C5C5C5", "y+ c #CFCFCF", "z+ c #949494", "A+ c #68696A", "B+ c #656666", "C+ c #D0D0D0", "D+ c #929292", "E+ c #676869", "F+ c #626363", "G+ c #747474", "H+ c #666460", "I+ c #65625B", "J+ c #70706D", "K+ c #707072", "L+ c #5F5B65", "M+ c #5C5B65", "N+ c #5D5D64", "O+ c #B9B9B9", "P+ c #603F03", "Q+ c #B18D00", "R+ c #B37B00", "S+ c #473414", "T+ c #211745", "U+ c #5600B3", "V+ c #2300B3", "W+ c #180062", "X+ c #684002", "Y+ c #C29906", "Z+ c #C67C02", "`+ c #4A2113", " @ c #2C495A", ".@ c #30546B", "+@ c #3B5F73", "@@ c #49173B", "#@ c #C60083", "$@ c #C30092", "%@ c #5E006B", "&@ c #683002", "*@ c #C48A04", "=@ c #C86800", "-@ c #4A2513", ";@ c #B7B7B7", ">@ c #261741", ",@ c #4C00AB", "'@ c #3D00A1", ")@ c #20006A", "!@ c #672A05", "~@ c #C84C02", "{@ c #C85904", "]@ c #4D0E0C", "^@ c #9A9A9A", "/@ c #888888", "(@ c #BCBCBC", "_@ c #626161", ":@ c #472A35", "<@ c #471A2B", "[@ c #483540", "}@ c #7B7B7B", "|@ c #5A5758", "1@ c #442434", "2@ c #471B25", "3@ c #4A3536", "4@ c #2D1746", "5@ c #5900C3", "6@ c #4800C8", "7@ c #23006B", "8@ c #554C54", "9@ c #544756", "0@ c #544755", "a@ c #575657", "b@ c #682C05", "c@ c #C83103", "d@ c #C81606", "e@ c #B90706", "f@ c #9A2200", "g@ c #625A58", "h@ c #7F1100", "i@ c #A71F05", "j@ c #A11306", "k@ c #564743", "l@ c #B6B6B6", "m@ c #5E0A17", "n@ c #A7051E", "o@ c #A7012A", "p@ c #431B2F", "q@ c #461622", "r@ c #A70029", "s@ c #A70026", "t@ c #5E031F", "u@ c #410A14", "v@ c #A3031F", "w@ c #C32019", "x@ c #C7111C", "y@ c #C00631", "z@ c #89110A", "A@ c #3B2620", "B@ c #BEBEBE", "C@ c #4D1005", "D@ c #AB2912", "E@ c #C4291F", "F@ c #C7220F", "G@ c #C03605", "H@ c #92120D", "I@ c #3A1616", "J@ c #4A1729", "K@ c #C70060", "L@ c #B40085", "M@ c #5F0054", "N@ c #615E5F", "O@ c #9B005E", "P@ c #B7007B", "Q@ c #8D005E", "R@ c #625F63", "S@ c #681E07", "T@ c #C82306", "U@ c #C81625", "V@ c #C80E35", "W@ c #B63100", "X@ c #635B58", "Y@ c #931601", "Z@ c #C83607", "`@ c #BE0632", " # c #574643", ".# c #6E081C", "+# c #C81638", "@# c #C8093A", "## c #491A2F", "$# c #4A161D", "%# c #C80829", "&# c #C80114", "*# c #6B0210", "=# c #4F0A09", "-# c #C4080E", ";# c #C82606", "># c #A42000", ",# c #843C00", "'# c #A82608", ")# c #C73018", "!# c #B54013", "~# c #3C2B2E", "{# c #8E8D8E", "]# c #621713", "^# c #BA141D", "/# c #C00F1E", "(# c #C31620", "_# c #C32E1B", ":# c #C2361B", "<# c #BD361B", "[# c #B0072B", "}# c #371C2E", "|# c #461731", "1# c #B90074", "2# c #B20079", "3# c #5E004D", "4# c #39093C", "5# c #A800B1", "6# c #AE00A2", "7# c #400A35", "8# c #BFBFBF", "9# c #63270C", "0# c #C85404", "a# c #C83120", "b# c #C82A0F", "c# c #B64500", "d# c #931F00", "e# c #C81D0F", "f# c #BE0631", "g# c #6E0211", "h# c #C80522", "i# c #C8004B", "j# c #491A31", "k# c #4A1D15", "l# c #C81B0D", "m# c #C8040F", "n# c #6B021D", "o# c #43323B", "p# c #B60049", "q# c #C8005C", "r# c #920031", "s# c #4F4748", "t# c #443745", "u# c #9C009D", "v# c #C600A0", "w# c #7E006A", "x# c #3A1936", "y# c #BB009B", "z# c #8300C8", "A# c #8B00C4", "B# c #670084", "C# c #5C0072", "D# c #8200AE", "E# c #7300C8", "F# c #6900C8", "G# c #3A0084", "H# c #27174A", "I# c #5F00C8", "J# c #3600C8", "K# c #1A0071", "L# c #464350", "M# c #2A0098", "N# c #2F00C8", "O# c #1D0099", "P# c #5E5E60", "Q# c #643106", "R# c #C85F00", "S# c #C8320B", "T# c #661504", "U# c #4A312B", "V# c #7A7676", "W# c #931200", "X# c #BE1009", "Y# c #574B43", "Z# c #6E0B09", "`# c #C80413", " $ c #C8001F", ".$ c #491A29", "+$ c #4A1F15", "@$ c #C8121D", "#$ c #C80024", "$$ c #6B022A", "%$ c #4E0137", "&$ c #C70085", "*$ c #C80066", "=$ c #450C24", "-$ c #666365", ";$ c #4E474B", ">$ c #8A006E", ",$ c #C60096", "'$ c #BA006E", ")$ c #50414B", "!$ c #680053", "~$ c #C00097", "{$ c #AC00B5", "]$ c #48035A", "^$ c #37263E", "/$ c #9900A0", "($ c #A300BD", "_$ c #7C00B4", ":$ c #524956", "<$ c #3F1748", "[$ c #A900B5", "}$ c #9D00B1", "|$ c #570074", "1$ c #362B49", "2$ c #8B0098", "3$ c #A200A7", "4$ c #64005F", "5$ c #604E08", "6$ c #C85700", "7$ c #C85500", "8$ c #46210C", "9$ c #931700", "0$ c #C81C00", "a$ c #BE2801", "b$ c #574C43", "c$ c #6E1500", "d$ c #C80C0E", "e$ c #C80806", "f$ c #491A1F", "g$ c #4A2715", "h$ c #C8151F", "i$ c #C80617", "j$ c #6B022C", "k$ c #700024", "l$ c #C80069", "m$ c #C80048", "n$ c #4A213A", "o$ c #6D0045", "p$ c #88004A", "q$ c #980060", "r$ c #9A0062", "s$ c #920045", "t$ c #412730", "u$ c #939393", "v$ c #7F0046", "w$ c #AB008F", "x$ c #99009B", "y$ c #463745", "z$ c #730057", "A$ c #A9008C", "B$ c #88008C", "C$ c #3F2D43", "D$ c #371734", "E$ c #8D0077", "F$ c #7B0081", "G$ c #3D0040", "H$ c #4D0134", "I$ c #820855", "J$ c #660055", "K$ c #3B3A45", "L$ c #523B08", "M$ c #C85D00", "N$ c #C84C00", "O$ c #692200", "P$ c #8A8A8A", "Q$ c #CBCBCB", "R$ c #932B01", "S$ c #C85302", "T$ c #BE1C14", "U$ c #564B42", "V$ c #6E1600", "W$ c #C8220A", "X$ c #C81208", "Y$ c #491920", "Z$ c #471A11", "`$ c #C80533", " % c #C81611", ".% c #6B0332", "+% c #600022", "@% c #C80073", "#% c #C8004E", "$% c #440E31", "%% c #9B9B9B", "&% c #9F9F9F", "*% c #680074", "=% c #8000C8", "-% c #6700C5", ";% c #341D3F", ">% c #CDCDCD", ",% c #39007F", "'% c #3E00C8", ")% c #322C4A", "!% c #1D174A", "~% c #3000C8", "{% c #1000BD", "]% c #000054", "^% c #1B123F", "/% c #2600C2", "(% c #0100B3", "_% c #05034D", ":% c #3B3421", "<% c #C55200", "[% c #C83005", "}% c #C30330", "|% c #6F1702", "1% c #544E49", "2% c #989898", "3% c #823503", "4% c #C87401", "5% c #C51A08", "6% c #422B10", "7% c #453D3C", "8% c #980705", "9% c #C84209", "0% c #C8040E", "a% c #5D031B", "b% c #524F50", "c% c #69012C", "d% c #C80155", "e% c #C8071A", "f% c #600337", "g% c #3A1125", "h% c #C5006A", "i% c #C80094", "j% c #8D005D", "k% c #565153", "l% c #6E6E6E", "m% c #3C0445", "n% c #6B00C8", "o% c #61009A", "p% c #2F173D", "q% c #3B2F3E", "r% c #818181", "s% c #3E007F", "t% c #5300C8", "u% c #1900C1", "v% c #2D2C49", "w% c #25174A", "x% c #5500C8", "y% c #2600C7", "z% c #090066", "A% c #5A5A5F", "B% c #100099", "C% c #0F00BA", "D% c #040094", "E% c #5C5C60", "F% c #828282", "G% c #7A3200", "H% c #C80A2C", "I% c #C8013A", "J% c #BF4100", "K% c #55483E", "L% c #542103", "M% c #C87902", "N% c #C83909", "O% c #C19100", "P% c #B92906", "Q% c #C81809", "R% c #C83B00", "S% c #C8260E", "T% c #C50033", "U% c #B50333", "V% c #C70C1A", "W% c #C80828", "X% c #C51E0B", "Y% c #3C1624", "Z% c #787677", "`% c #80002C", " & c #C80074", ".& c #9C004C", "+& c #7A004C", "@& c #7B0060", "#& c #5B555A", "$& c #D5D5D5", "%& c #5C585E", "&& c #7C0094", "*& c #A100C7", "=& c #9600C8", "-& c #A700C8", ";& c #69006F", ">& c #77007D", ",& c #A600C8", "'& c #8B00C6", ")& c #3C2C4A", "!& c #401745", "~& c #AC00B9", "{& c #B400C1", "]& c #4E006A", "^& c #A7A7A7", "/& c #59005E", "(& c #B300BF", "_& c #C000A1", ":& c #3E0A37", "<& c #504946", "[& c #7E1205", "}& c #C40607", "|& c #BF6900", "1& c #554C3E", "2& c #4D4642", "3& c #A35601", "4& c #C82310", "5& c #C87500", "6& c #C82300", "7& c #BC1A00", "8& c #5A1305", "9& c #771A02", "0& c #C6011D", "a& c #C8071B", "b& c #C81502", "c& c #C70712", "d& c #750F02", "e& c #504247", "f& c #7F004E", "g& c #C60058", "h& c #C80053", "i& c #C600A3", "j& c #B300AC", "k& c #620061", "l& c #422C42", "m& c #67008F", "n& c #8400C8", "o& c #7800C8", "p& c #560072", "q& c #63007F", "r& c #9800C8", "s& c #6A00C7", "t& c #392C4A", "u& c #301747", "v& c #7600C2", "w& c #7000C5", "x& c #2C006A", "y& c #2C1E3A", "z& c #3600C1", "A& c #4300B2", "B& c #11007A", "C& c #7D7D7D", "D& c #7B7979", "E& c #391514", "F& c #5C2B00", "G& c #514942", "H& c #433835", "I& c #651301", "J& c #954A00", "K& c #781B00", "L& c #391C1B", "M& c #767373", "N& c #47090A", "O& c #8A0214", "P& c #8B020F", "Q& c #48050A", "R& c #6C6767", "S& c #797879", "T& c #39121F", "U& c #600028", "V& c #700056", "W& c #4D0246", "X& c #423342", "Y& c #6A686B", "Z& c #300C3A", "`& c #4D0060", " * c #420243", ".* c #2F022E", "+* c #42014E", "@* c #3E014E", "#* c #3B343F", "$* c #2A1E31", "%* c #30014E", "&* c #25014E", "** c #10022B", "=* c #6A6A6B", "-* c #1E0248", ";* c #1F014E", ">* c #140249", ",* c #292929", "'* c #868686", ")* c #8C8C8C", " ", " ", " ", " . + @ # ", " $ % & * = ", " - ; > , ' = ", " ) ! ~ { ] = ", " ^ / ( _ : < [ } | = 1 2 3 4 5 6 7 8 3 9 5 0 a b ", " c d e f g h i j * k l m n o p > k q r s t u p > k * v 7 ", " w x y f z b 3 A B C D D E m F r G D H H I I J K L M N O D D D H P Q ", " w R S f T U 5 V W D D X Y $ Z ` D ...+.@.I #.$.%.&.*.=.-.;.>.k I D I ,.b ", " w '.S f ).!.= ~.{.D ].^./.(._.:.D <.[.L }.|.1.2.3.4.5.6.7.8.9.0.a.D D q b. ", " w '.S f ).!.= c.d.e.f.g. 7 h.i.j.k.l.p m.n.o.p.q.Q r.6.s.t.u.v.w.x.D y.z. ", " w '.S f A.B.= c.C.D.E.F. G.H.I.J.K.s L.M.N.O.P.Q.R.S.6.T.U.u.v.V.> D I W. ", " w '.S f X.Y.Z. c.C.D.E.F. `. +I..+++@+#+[. $+5.6.7.%+&+*+=+-+D I W. ", " w '.S f ;+ c.C.D.E.F. &.>+,+.+'+)+!+~+# #+{+]+7.^+/+(+_+:+<+[+W. ", " w '.S f ;+ c.C.D.E.F. }+|+1+7.2+3+4+5+6+ t 7+8+6.6.9+0+a+b+c+W. ", " w d+e+f+g+ h+i+j+k+F. F.l+m+n+o+p+q+| (.r+s+t+u+0+a+7.v+W. ", " 8 b.b.b.w+ F.b.b.b.x+ y+z+A+B+[ m C+D+E+F+G+a+7.v+W. ", " 8 H+I+I+J+ V.a+7.v+W. K+L+M+N+8 ", " O+P+Q+R+S+ V.a+7.v+W. T+U+V+W++ ", " O+X+Y+Z+`+ V. @.@+@W. @@#@$@%@+ ", " O+&@*@=@-@ 6+F.F.F.;@ >@,@'@)@+ ", " O+!@~@{@]@5 9 ;@5 5 5 ^@- 5 5 5 /@ g.5 5 1 - (@_@:@<@[@}@b L |@1@2@3@G+8 4@5@6@7@+ (@8@9@0@a@&. ", " O+b@c@d@e@f@g@ G.h@i@j@k@l@m@n@o@p@ q@r@s@t@;@ | u@v@w@x@y@z@A@B@ V.C@D@E@F@G@H@I@# J@K@L@M@+ N@O@P@Q@R@ ", " O+S@T@U@V@W@X@ G.Y@Z@`@ #l@.#+#@### $#%#&#*#;@ (.=#-#;#>#,#'#)#!#~#} {#]#^#/#(#_#:#<#[#}#b |#1#2#3#Y.4#5#6#7#8# ", " O+9#0#a#b#c#X@ G.d#e#f# #l@g#h#i#j# k#l#m#n#;@ o#p#q#r#s#^@t#u#v#w#[ #+x#y#z#A#B#C#D#E#F#G#[ H#I#J#K#L#M#N#O#P# ", " O+Q#R#S#T#U#V# G.W#e#X#Y#l@Z#`# $.$ +$@$#$$$;@A %$&$*$=$$+-$;$>$,$'$)$`.!$~${$]$V.}+^$/$($_$:$ <$[$}$|$1$2$3$4$D+ ", " O+5$6$7$8$ G.9$0$a$b$l@c$d$e$f$ g$h$i$j$;@`.k$l$m$n$s o$p$q$r$s$t$u$v$w$x$y$v.v.| z$A$B$C$ D$E$F$G$V.H$I$J$K$. ", " x+L$M$N$O$P$Q$ G.R$S$T$U$n V$W$X$Y$ Z$`$ %.%;@h +%@%#%$%@+R.R.R.R.R.%%&%*%=%-%;%>%v.Y.,%F#'%)% !%~%{%]%@+^%/%(%_%n ", " :%<%[%}%|%1% 2%3%4%5%6%7%8%9%0%a%b%c%d%e%f%+ . g%h%i%j%k%9 l%2 A m%n%E#o%p%q%r%s%t%u%v% w%x%y%z%+ A%B%C%D%E% ", " F%G%H%I%J%K% (@L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%&. Z%`% &i#.&+&@&#&$& %&&&*&=&-&;&V.>&,&'&)& !&~&{&]&+ ^&/&(&_&:&Q$ ", " #+<&[&}&|&1& . 2&3&4&5&6&7&8&9&0&a&b&c&d&V. 3 e&f&g&h&i&j&k&}@ ^ l&m&n&o&p&V.q&r&s&t& u&v&w&x&+ 3 y&z&A&B&C& ", " 3 D&E&F&G& m H&I&J&K&L&(.M&N&O&P&Q&R&$& 3 S&T&U&V&W&X&w b Y&Z&`& *V..*+*@*#* $*%*&***+ =*-*;*>*,*#+ ", " [.(@ w '*2%2 6+)*b.8# . O+c 8 $&[.`.3 ", " ", " ", " ", " ", " "}; freqtweak-0.7.2/src/pixmap_includes.hpp0000644000175200017520000000273311226173741017172 0ustar develdevel // // /bin/ls -1 pixmaps/*.xpm | awk '{}{ printf "#include \"%s\"\n", $1 }' // #ifndef __freqtweak_pixmap_includes__ #define __freqtweak_pixmap_includes__ #include "pixmaps/barplot_active.xpm" #include "pixmaps/barplot_disabled.xpm" #include "pixmaps/barplot_focus.xpm" #include "pixmaps/barplot_normal.xpm" #include "pixmaps/barplot_selected.xpm" #include "pixmaps/bypass_active.xpm" #include "pixmaps/bypass_disabled.xpm" #include "pixmaps/bypass_focus.xpm" #include "pixmaps/bypass_normal.xpm" #include "pixmaps/bypass_selected.xpm" #include "pixmaps/grid_active.xpm" #include "pixmaps/grid_disabled.xpm" #include "pixmaps/grid_focus.xpm" #include "pixmaps/grid_normal.xpm" #include "pixmaps/grid_selected.xpm" #include "pixmaps/gridsnap_active.xpm" #include "pixmaps/gridsnap_disabled.xpm" #include "pixmaps/gridsnap_focus.xpm" #include "pixmaps/gridsnap_normal.xpm" #include "pixmaps/gridsnap_selected.xpm" #include "pixmaps/lineplot_active.xpm" #include "pixmaps/lineplot_disabled.xpm" #include "pixmaps/lineplot_focus.xpm" #include "pixmaps/lineplot_normal.xpm" #include "pixmaps/lineplot_selected.xpm" #include "pixmaps/link_active.xpm" #include "pixmaps/link_disabled.xpm" #include "pixmaps/link_focus.xpm" #include "pixmaps/link_normal.xpm" #include "pixmaps/link_selected.xpm" #include "pixmaps/specplot_active.xpm" #include "pixmaps/specplot_disabled.xpm" #include "pixmaps/specplot_focus.xpm" #include "pixmaps/specplot_normal.xpm" #include "pixmaps/specplot_selected.xpm" #endif freqtweak-0.7.2/src/FThelpWindow.cpp0000644000175200017520000000412111226173741016344 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include "FThelpWindow.hpp" FThelpWindow::FThelpWindow(wxWindow * parent, wxWindowID id, const wxString & title, const wxPoint& pos, const wxSize& size, long style, const wxString& name) : wxFrame(parent, id, title, pos, size, style, name) { init(); } FThelpWindow::~FThelpWindow() { } void FThelpWindow::init() { wxBoxSizer * mainsizer = new wxBoxSizer(wxVERTICAL); _htmlWin = new wxHtmlWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxHW_SCROLLBAR_AUTO); mainsizer->Add (_htmlWin, 1, wxALL|wxEXPAND, 4); SetAutoLayout( TRUE ); mainsizer->Fit( this ); mainsizer->SetSizeHints( this ); SetSizer( mainsizer ); const int sizes[] = {7, 8, 10, 12, 16, 22, 30}; _htmlWin->SetFonts(wxT(""), wxT(""), sizes); #ifndef __WXMAC__ wxString helppath = wxString(wxT(HELP_HTML_PATH)) + wxFileName::GetPathSeparator() + wxString(wxT("usagehelp.html")); #else wxString helppath(wxT("")); #endif if (wxFile::Access(helppath, wxFile::read)) { _htmlWin->LoadPage(helppath); } else { _htmlWin->SetPage(wxString(wxT("Help information could not be found at ")) + helppath + wxString(wxT(" . If you can't get it, please see http://freqtweak.sf.net"))); } this->SetSizeHints(200,100); this->SetSize(600,400); } freqtweak-0.7.2/src/FThelpWindow.hpp0000644000175200017520000000253711226173741016362 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTHELPWIN_HPP__ #define __FTHELPWIN_HPP__ #include #include #include "FTtypes.hpp" #include #include using namespace std; class FThelpWindow : public wxFrame { public: FThelpWindow(wxWindow * parent, wxWindowID id, const wxString & title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(400,600), long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("HelpWin")); virtual ~FThelpWindow(); protected: void init(); wxHtmlWindow * _htmlWin; }; #endif freqtweak-0.7.2/src/FTmodulatorI.cpp0000644000175200017520000000501211226173741016343 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include "FTmodulatorI.hpp" #include using namespace std; using namespace PBD; FTmodulatorI::FTmodulatorI(string confname, string name, nframes_t samplerate, unsigned int fftn) : _inited(false), _name(name), _confname(confname), _userName("Unnamed"), _bypassed(false), _sampleRate(samplerate), _fftN(fftn) { } FTmodulatorI::~FTmodulatorI() { clearSpecMods(); GoingAway(this); // emit } void FTmodulatorI::goingAway(FTspectrumModifier * ft) { LockMonitor pmlock(_specmodLock, __LINE__, __FILE__); _specMods.remove (ft); } void FTmodulatorI::addSpecMod (FTspectrumModifier * specmod) { if (!specmod) return; LockMonitor pmlock(_specmodLock, __LINE__, __FILE__); if (find(_specMods.begin(), _specMods.end(), specmod) == _specMods.end()) { specmod->registerListener(this); _specMods.push_back (specmod); } } void FTmodulatorI::removeSpecMod (FTspectrumModifier * specmod) { if (!specmod) return; LockMonitor pmlock(_specmodLock, __LINE__, __FILE__); _specMods.remove (specmod); specmod->unregisterListener(this); specmod->setDirty(false); } void FTmodulatorI::clearSpecMods () { LockMonitor pmlock(_specmodLock, __LINE__, __FILE__); for (SpecModList::iterator iter = _specMods.begin(); iter != _specMods.end(); ++iter) { (*iter)->unregisterListener(this); (*iter)->setDirty(false); } _specMods.clear(); } void FTmodulatorI::getSpecMods (SpecModList & mods) { LockMonitor pmlock(_specmodLock, __LINE__, __FILE__); mods.insert (mods.begin(), _specMods.begin(), _specMods.end()); } bool FTmodulatorI::hasSpecMod (FTspectrumModifier *specmod) { LockMonitor pmlock(_specmodLock, __LINE__, __FILE__); return (find(_specMods.begin(), _specMods.end(), specmod) != _specMods.end()); } freqtweak-0.7.2/src/FTmodulatorI.hpp0000644000175200017520000001347011226173741016357 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTMODULATORI_HPP__ #define __FTMODULATORI_HPP__ #include "FTtypes.hpp" #include #include #include #include #include #include "LockMonitor.hpp" #include "FTspectrumModifier.hpp" class FTmodulatorI : public FTspectrumModifier::Listener { public: virtual ~FTmodulatorI(); virtual FTmodulatorI * clone() = 0; virtual void initialize() = 0; virtual void modulate (nframes_t current_frame, fft_data * fftdata, unsigned int fftn, sample_t * timedata, nframes_t nframes) = 0; virtual void goingAway(FTspectrumModifier * ft); typedef std::list SpecModList; virtual void addSpecMod (FTspectrumModifier * specmod); virtual void removeSpecMod (FTspectrumModifier * specmod); virtual void clearSpecMods (); virtual void getSpecMods (SpecModList & mods); virtual bool hasSpecMod (FTspectrumModifier *specmod); virtual std::string getUserName() { return _userName; } virtual void setUserName (std::string username) { _userName = username; } virtual std::string getName() { return _name; } virtual void setFFTsize (unsigned int fftn) { _fftN = fftn; } virtual void setSampleRate (nframes_t rate) { _sampleRate = rate; } virtual nframes_t getSampleRate() { return _sampleRate; } virtual const string & getConfName() { return _confname; } virtual bool getBypassed() { return _bypassed; } virtual void setBypassed(bool byp) { _bypassed = byp; } SigC::Signal1 GoingAway; class Control { public: enum Type { BooleanType = 1, IntegerType, FloatType, StringType, EnumType }; Control (Type t, std::string confname, std::string name, std::string units) : _type(t), _confname(confname), _name(name), _units(units) {} Type getType() { return _type; } std::string getConfName() { return _confname; } std::string getName() { return _name; } std::string getUnits() { return _units; } inline bool getValue(bool & val); inline bool getValue(int & val); inline bool getValue(float & val); // for string or enum type inline bool getValue(std::string & val); inline bool getEnumStrings (std::list & vals); inline bool getBounds(int & lb, int & ub); inline bool getBounds(float & lb, float & ub); inline bool setValue(bool val); inline bool setValue(int val); inline bool setValue(float val); // for string or enum type inline bool setValue(const std::string & val); int _intLB, _intUB; float _floatLB, _floatUB; std::list _enumList; friend class FTmodulatorI; protected: Type _type; std::string _confname; std::string _name; std::string _units; std::string _stringVal; float _floatVal; int _intVal; bool _boolVal; }; typedef std::list ControlList; virtual void getControls (ControlList & conlist) { conlist.insert (conlist.begin(), _controls.begin(), _controls.end()); } protected: FTmodulatorI(std::string confname, std::string name, nframes_t samplerate, unsigned int fftn); ControlList _controls; SpecModList _specMods; PBD::NonBlockingLock _specmodLock; bool _inited; std::string _name; std::string _confname; std::string _userName; bool _bypassed; nframes_t _sampleRate; unsigned int _fftN; int _id; }; inline bool FTmodulatorI::Control::getValue(bool & val) { if (_type != BooleanType) return false; val = _boolVal; return true; } inline bool FTmodulatorI::Control::getValue(int & val) { if (_type != IntegerType) return false; val = _intVal; return true; } inline bool FTmodulatorI::Control::getValue(float & val) { if (_type != FloatType) return false; val = _floatVal; return true; } // for string or enum type inline bool FTmodulatorI::Control::getValue(std::string & val) { if (_type != StringType && _type != EnumType) return false; val = _stringVal; return true; } inline bool FTmodulatorI::Control::getEnumStrings (std::list & vals) { if (_type != EnumType) return false; vals.insert(vals.begin(), _enumList.begin(), _enumList.end()); return true; } inline bool FTmodulatorI::Control::getBounds(int & lb, int & ub) { if (_type != IntegerType) return false; lb = _intLB; ub = _intUB; return true; } inline bool FTmodulatorI::Control::getBounds(float & lb, float & ub) { if (_type != FloatType) return false; lb = _floatLB; ub = _floatUB; return true; } inline bool FTmodulatorI::Control::setValue(bool val) { if (_type != BooleanType) return false; _boolVal = val; return true; } inline bool FTmodulatorI::Control::setValue(int val) { if (_type != IntegerType) return false; _intVal = val; return true; } inline bool FTmodulatorI::Control::setValue(float val) { if (_type != FloatType) return false; _floatVal = val; return true; } // for string or enum type inline bool FTmodulatorI::Control::setValue(const std::string & val) { if (_type == StringType) { _stringVal = val; return true; } else if (_type == EnumType && std::find(_enumList.begin(), _enumList.end(), val) != _enumList.end()) { _stringVal = val; return true; } return false; } #endif freqtweak-0.7.2/src/FTmodulatorDialog.cpp0000644000175200017520000002123511226173741017357 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include #include #include using namespace std; #include "FTmodulatorDialog.hpp" #include "FTmodulatorManager.hpp" #include "FTioSupport.hpp" #include "FTmainwin.hpp" #include "FTdspManager.hpp" #include "FTprocI.hpp" #include "FTmodulatorI.hpp" #include "FTprocessPath.hpp" #include "FTspectralEngine.hpp" #include "FTmodulatorGui.hpp" #include using namespace SigC; enum { ID_AddButton=8000, ID_PopupMenu, ID_EditMenuItem, ID_RemoveMenuItem, ID_ChannelList, ID_ClearButton }; enum { ID_AddModulatorBase = 9000, ID_AddModulatorChannelBase = 9100, ID_AddModulatorChannelMax = 9110 }; BEGIN_EVENT_TABLE(FTmodulatorDialog, wxFrame) EVT_CLOSE(FTmodulatorDialog::onClose) EVT_IDLE(FTmodulatorDialog::OnIdle) EVT_SIZE (FTmodulatorDialog::onSize) EVT_PAINT (FTmodulatorDialog::onPaint) EVT_BUTTON (ID_ClearButton, FTmodulatorDialog::onClearButton) EVT_COMMAND_RANGE(ID_AddModulatorChannelBase, ID_AddModulatorChannelMax, wxEVT_COMMAND_BUTTON_CLICKED, FTmodulatorDialog::onAddButton) END_EVENT_TABLE() class FTaddmodObject : public wxObject { public: FTaddmodObject(int ind) : index(ind) {} int index; }; FTmodulatorDialog::FTmodulatorDialog(FTmainwin * parent, wxWindowID id, const wxString & title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxFrame(parent, id, title, pos, size, style, name), _clickedChannel(-1), _mainwin(parent) { init(); } FTmodulatorDialog::~FTmodulatorDialog() { } void FTmodulatorDialog::onSize(wxSizeEvent &ev) { _justResized = true; ev.Skip(); } void FTmodulatorDialog::onPaint(wxPaintEvent &ev) { if (_justResized) { //int width,height; _justResized = false; // for (int i=0; i < _channelCount; ++i) // { // _channelLists[i]->GetClientSize(&width, &height); // _channelLists[i]->SetColumnWidth(0, width); // } } ev.Skip(); } void FTmodulatorDialog::init() { wxBoxSizer * mainsizer = new wxBoxSizer(wxVERTICAL); //wxStaticText * statText; _channelSizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer * rowsizer = new wxBoxSizer(wxHORIZONTAL); wxButton *addButt = new wxButton(this, ID_AddModulatorChannelBase, wxT("Add Modulator...")); rowsizer->Add (addButt, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 4); rowsizer->Add (2,1,1); wxButton *clearButt = new wxButton(this, ID_ClearButton, wxT("Remove All")); rowsizer->Add (clearButt, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 4); mainsizer->Add (rowsizer, 0, wxALL|wxEXPAND); _channelScroller = new wxScrolledWindow(this, -1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER); _channelSizer = new wxBoxSizer(wxVERTICAL); _channelScroller->SetSizer(_channelSizer); _channelScroller->SetAutoLayout(true); _channelScroller->SetScrollRate (10, 30); _channelScroller->EnableScrolling (true, true); mainsizer->Add (_channelScroller, 1, wxEXPAND|wxALL, 3); wxMenuItem * item; _popupMenu = new wxMenu(); int itemid = ID_AddModulatorBase; FTmodulatorManager::ModuleList mlist; FTmodulatorManager::instance()->getAvailableModules(mlist); int modnum = 0; for (FTmodulatorManager::ModuleList::iterator moditer = mlist.begin(); moditer != mlist.end(); ++moditer) { item = new wxMenuItem(_popupMenu, itemid, wxString::FromAscii ((*moditer)->getName().c_str())); _popupMenu->Append (item); Connect( itemid, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &FTmodulatorDialog::onAddModulator, (wxObject *) (new FTaddmodObject(modnum++))); itemid++; } refreshState(); SetAutoLayout( TRUE ); mainsizer->Fit( this ); mainsizer->SetSizeHints( this ); SetSizer( mainsizer ); // this->SetSizeHints(200,100); } void FTmodulatorDialog::refreshState() { // first time only FTioSupport * iosup = FTioSupport::instance(); FTprocessPath * procpath; for (int i=0; i < iosup->getActivePathCount(); ++i) { procpath = iosup->getProcessPath(i); if (procpath) { FTspectralEngine *engine = procpath->getSpectralEngine(); engine->ModulatorAdded.connect( bind (slot (*this, &FTmodulatorDialog::onModulatorAdded), i)); vector modlist; modlist.clear(); engine->getModulators (modlist); for (vector::iterator iter=modlist.begin(); iter != modlist.end(); ++iter) { FTmodulatorI * mod = (*iter); appendModGui (mod, false); } } } _channelScroller->Layout(); _channelScroller->SetScrollRate(10,30); // if (_lastSelected >= 0 && _lastSelected < _targetList->GetItemCount()) { // _targetList->SetItemState (_lastSelected, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); // } } void FTmodulatorDialog::appendModGui(FTmodulatorI * mod, bool layout) { FTmodulatorGui *modgui = new FTmodulatorGui(FTioSupport::instance(), mod, _channelScroller, -1); modgui->RemovalRequest.connect (bind (slot (*this, &FTmodulatorDialog::onModulatorDeath), mod)); mod->GoingAway.connect ( slot (*this, &FTmodulatorDialog::onModulatorDeath)); _modulatorGuis[mod] = modgui; _channelSizer->Add(modgui, 0, wxEXPAND|wxALL, 1); if (layout) { _channelScroller->SetClientSize(_channelScroller->GetClientSize()); _channelScroller->Layout(); // _channelScroller->SetScrollbars(1,1,10,30); } } void FTmodulatorDialog::onClose(wxCloseEvent & ev) { if (!ev.CanVeto()) { Destroy(); } else { ev.Veto(); Show(false); } } void FTmodulatorDialog::onClearButton (wxCommandEvent &ev) { // remove all modulators for (int i=0; i < FTioSupport::instance()->getActivePathCount(); i++) { FTprocessPath * procpath = FTioSupport::instance()->getProcessPath(i); if (procpath) { FTspectralEngine *engine = procpath->getSpectralEngine(); engine->clearModulators (); } } } void FTmodulatorDialog::onAddButton (wxCommandEvent &ev) { wxWindow * source = (wxWindow *) ev.GetEventObject(); _clickedChannel = ev.GetId() - ID_AddModulatorChannelBase; wxRect pos = source->GetRect(); PopupMenu(_popupMenu, pos.x, pos.y + pos.height); } void FTmodulatorDialog::onAddModulator (wxCommandEvent &ev) { FTaddmodObject * mobj = (FTaddmodObject *)ev.m_callbackUserData; if (!mobj) return; FTmodulatorI * protomod = FTmodulatorManager::instance()->getModuleByIndex(mobj->index); //cerr << "add modulator: " << (unsigned) protomod << " clicked chan: " << _clickedChannel << " " << (unsigned) this << endl; if (protomod) { FTmodulatorI * mod = protomod->clone(); mod->initialize(); appendModGui (mod, true); // you can change its channel later FTprocessPath * procpath = FTioSupport::instance()->getProcessPath(0); if (procpath) { FTspectralEngine *engine = procpath->getSpectralEngine(); engine->appendModulator (mod); // refreshState(); } } } void FTmodulatorDialog::OnIdle(wxIdleEvent &ev) { if (_deadGuis.size() > 0) { for (list::iterator iter = _deadGuis.begin(); iter != _deadGuis.end(); ++iter) { (*iter)->Destroy(); } _deadGuis.clear(); } ev.Skip(); } void FTmodulatorDialog::onModulatorDeath (FTmodulatorI * mod) { //cerr << "mod death: " << mod->getName() << endl; if (_modulatorGuis.find (mod) != _modulatorGuis.end()) { //cerr << "deleting modgui" << endl; FTmodulatorGui * modgui = _modulatorGuis[mod]; _channelSizer->Remove (modgui); modgui->Show(false); _channelScroller->SetClientSize(_channelScroller->GetClientSize()); _channelScroller->Layout(); //_channelScroller->SetScrollbars(1,1,10,30); _deadGuis.push_back(modgui); _modulatorGuis.erase(mod); ::wxWakeUpIdle(); } } void FTmodulatorDialog::onModulatorAdded (FTmodulatorI * mod, int channel) { if (_modulatorGuis.find(mod) == _modulatorGuis.end()) { FTprocessPath * procpath = FTioSupport::instance()->getProcessPath (channel); if (procpath) { // FTspectralEngine *engine = procpath->getSpectralEngine(); appendModGui (mod, true); } } } freqtweak-0.7.2/src/FTmodulatorDialog.hpp0000644000175200017520000000475111226173741017370 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTMODULATORDIALOG_HPP__ #define __FTMODULATORDIALOG_HPP__ #include #include #include #include #include "FTtypes.hpp" class FTprocI; class FTmainwin; class FTmodulatorI; class FTmodulatorGui; class FTmodulatorDialog : public wxFrame, public SigC::Object { public: // ctor(s) FTmodulatorDialog(FTmainwin * parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(400,600), long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("ModulatorDialog")); virtual ~FTmodulatorDialog(); void OnIdle(wxIdleEvent &ev); protected: void init(); void refreshState(); void onClose(wxCloseEvent & ev); void onCommit(wxCommandEvent & ev); void onSize(wxSizeEvent &ev); void onPaint(wxPaintEvent &ev); void onAddModulator (wxCommandEvent &ev); void onAddButton (wxCommandEvent &ev); void onClearButton (wxCommandEvent &ev); void onModulatorDeath (FTmodulatorI * mod); void onModulatorAdded (FTmodulatorI * mod, int channel); void appendModGui(FTmodulatorI * mod, bool layout=true); // void onAutoCheck (wxCommandEvent &ev); wxScrolledWindow * _channelScrollers[FT_MAXPATHS]; wxBoxSizer * _channelSizers[FT_MAXPATHS]; wxScrolledWindow * _channelScroller; wxBoxSizer * _channelSizer; int _channelCount; wxBoxSizer * _chanlistSizer; wxMenu * _popupMenu; int _clickedChannel; FTmainwin * _mainwin; std::map _modulatorGuis; std::list _deadGuis; bool _justResized; int _lastSelected; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; #endif freqtweak-0.7.2/src/FTmodValueLFO.cpp0000644000175200017520000001322611226173741016347 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTmodValueLFO.hpp" #include "FTutils.hpp" #include #include #include using namespace std; using namespace PBD; FTmodValueLFO::FTmodValueLFO (nframes_t samplerate, unsigned int fftn) : FTmodulatorI ("ValueLFO", "Value LFO", samplerate, fftn) { } FTmodValueLFO::FTmodValueLFO (const FTmodValueLFO & other) : FTmodulatorI ("ValueLFO", "Value LFO", other._sampleRate, other._fftN) { } void FTmodValueLFO::initialize() { _lastframe = 0; _rate = new Control (Control::FloatType, "rate", "Rate", "Hz"); _rate->_floatLB = 0.0; _rate->_floatUB = 20.0; _rate->setValue (0.0f); _controls.push_back (_rate); _depth = new Control (Control::FloatType, "depth", "Depth", "%"); _depth->_floatLB = 0.0; _depth->_floatUB = 100.0; _depth->setValue (0.0f); _controls.push_back (_depth); _lfotype = new Control (Control::EnumType, "lfo_type", "LFO Type", ""); _lfotype->_enumList.push_back("Sine"); _lfotype->_enumList.push_back("Triangle"); _lfotype->_enumList.push_back("Square"); _lfotype->setValue (string("Sine")); _controls.push_back (_lfotype); _minfreq = new Control (Control::FloatType, "min_freq", "Min Freq", "Hz"); _minfreq->_floatLB = 0.0; _minfreq->_floatUB = _sampleRate / 2; _minfreq->setValue (_minfreq->_floatLB); _controls.push_back (_minfreq); _maxfreq = new Control (Control::FloatType, "max_freq", "Max Freq", "Hz"); _maxfreq->_floatLB = 0.0; _maxfreq->_floatUB = _sampleRate / 2; _maxfreq->setValue (_maxfreq->_floatUB); _controls.push_back (_maxfreq); _tmpfilt = new float[_fftN]; _inited = true; } FTmodValueLFO::~FTmodValueLFO() { if (!_inited) return; _controls.clear(); delete _rate; delete _depth; delete _lfotype; delete _minfreq; delete _maxfreq; } void FTmodValueLFO::addSpecMod (FTspectrumModifier * specmod) { { LockMonitor pmlock(_specmodLock, __LINE__, __FILE__); _lastshifts[specmod] = 0.0; } FTmodulatorI::addSpecMod (specmod); } void FTmodValueLFO::removeSpecMod (FTspectrumModifier * specmod) { FTmodulatorI::removeSpecMod (specmod); LockMonitor pmlock(_specmodLock, __LINE__, __FILE__); _lastshifts.erase(specmod); } void FTmodValueLFO::clearSpecMods () { FTmodulatorI::clearSpecMods(); LockMonitor pmlock(_specmodLock, __LINE__, __FILE__); _lastshifts.clear(); } void FTmodValueLFO::setFFTsize (unsigned int fftn) { _fftN = fftn; if (_inited) { delete _tmpfilt; _tmpfilt = new float[_fftN]; } } void FTmodValueLFO::modulate (nframes_t current_frame, fft_data * fftdata, unsigned int fftn, sample_t * timedata, nframes_t nframes) { TentativeLockMonitor lm (_specmodLock, __LINE__, __FILE__); if (!lm.locked() || !_inited || _bypassed) return; float rate = 1.0; double currdev = 0.0; float ub,lb, tmplb, tmpub; float * filter; int len; float minfreq, maxfreq; float depth = 1.0; unsigned int minbin, maxbin; float shiftval = 0; double current_secs; double lastshift; string shape; // in hz _rate->getValue (rate); _lfotype->getValue (shape); // in % _depth->getValue (depth); _minfreq->getValue (minfreq); _maxfreq->getValue (maxfreq); if (minfreq >= maxfreq) { return; } current_secs = current_frame / (double) _sampleRate; if (current_frame != _lastframe) { // fprintf (stderr, "shift at %lu : samps=%g s*c=%g s*e=%g \n", (unsigned long) current_frame, samps, (current_frame/samps), ((current_frame + nframes)/samps) ); for (SpecModList::iterator iter = _specMods.begin(); iter != _specMods.end(); ++iter) { FTspectrumModifier * sm = (*iter); if (sm->getBypassed()) continue; // cerr << "shiftval is: " << shiftval // << " hz/bin: " << hzperbin // << " rate: " << rate << endl; filter = sm->getValues(); sm->getRange(tmplb, tmpub); len = (int) sm->getLength(); minbin = (int) ((minfreq*2/ _sampleRate) * len); maxbin = (int) ((maxfreq*2/ _sampleRate) * len); // lb = tmplb + (tmpub-tmplb) * minval*0.01; // ub = tmplb + (tmpub-tmplb) * maxval*0.01; lb = tmplb; ub = tmpub; len = maxbin - minbin; if (len <= 0) { continue; } if (shape == "Sine") { currdev = (double) (FTutils::sine_wave (current_secs, (double) rate) * ( (ub-lb)* (depth * 0.01) * 0.5 )); } else if (shape == "Square") { currdev = (double) (FTutils::square_wave (current_secs, (double) rate) * ( (ub-lb)* (depth * 0.01) * 0.5 )); } else if (shape == "Triangle") { currdev = (double) (FTutils::triangle_wave (current_secs, (double) rate) * ( (ub-lb)* (depth * 0.01) * 0.5 )); } else { continue; } lastshift = _lastshifts[sm]; shiftval = (float) (currdev - lastshift); // fprintf(stderr, "shifting %d %d:%d at %lu\n", shiftbins, minbin, maxbin, (unsigned long) current_frame); for (unsigned int i=minbin; i < maxbin; ++i) { filter[i] += shiftval; } sm->setDirty(true); _lastshifts[sm] = currdev; } _lastframe = current_frame; } } freqtweak-0.7.2/src/FTmodValueLFO.hpp0000644000175200017520000000322111226173741016346 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTMODVALUELFO_HPP__ #define __FTMODVALUELFO_HPP__ #include "FTmodulatorI.hpp" #include class FTmodValueLFO : public FTmodulatorI { public: FTmodValueLFO(nframes_t samplerate, unsigned int fftn); FTmodValueLFO (const FTmodValueLFO & other); virtual ~FTmodValueLFO(); FTmodulatorI * clone() { return new FTmodValueLFO(*this); } void initialize(); void modulate (nframes_t current_frame, fft_data * fftdata, unsigned int fftn, sample_t * timedata, nframes_t nframes); void setFFTsize (unsigned int fftn); void addSpecMod (FTspectrumModifier * specmod); void removeSpecMod (FTspectrumModifier * specmod); void clearSpecMods (); protected: Control * _rate; Control * _depth; Control * _lfotype; Control * _minfreq; Control * _maxfreq; nframes_t _lastframe; std::map _lastshifts; float * _tmpfilt; }; #endif freqtweak-0.7.2/src/FTconfigManager.cpp0000644000175200017520000011346711226173741017002 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include "FTconfigManager.hpp" #include "FTspectrumModifier.hpp" #include "FTspectralEngine.hpp" #include "FTioSupport.hpp" #include "FTprocessPath.hpp" #include "FTdspManager.hpp" #include "FTmodulatorManager.hpp" #include "FTprocI.hpp" #include "FTmodulatorI.hpp" #include "version.h" #include "xml++.hpp" using namespace std; FTconfigManager::FTconfigManager(const std::string & basedir) : _basedir (basedir) { if (_basedir.empty()) { _basedir = (wxGetHomeDir() + wxFileName::GetPathSeparator() + wxT(".freqtweak")).fn_str(); } // try to create basedir if it doesn't exist //wxDir bdir(_basedir); if ( ! wxDir::Exists(wxString::FromAscii (_basedir.c_str())) ) { if (mkdir ( _basedir.c_str(), 0755 )) { fprintf (stderr, "Error creating %s\n", _basedir.c_str()); } else { fprintf(stderr, "Created settings directory: %s\n", _basedir.c_str()); } } else { //printf ("config dir exists\n"); } // make basedir/presets dir wxString predir (wxString::FromAscii (_basedir.c_str()) + wxFileName::GetPathSeparator() + wxT("presets")); if ( ! wxDir::Exists(predir) ) { if (mkdir (predir.fn_str(), 0755 )) { fprintf (stderr, "Error creating %s\n", static_cast (predir.mb_str())); } else { fprintf(stderr, "Created presets directory: %s\n", static_cast (predir.mb_str())); } } else { //printf ("config_presets dir exists\n"); } } FTconfigManager::~FTconfigManager() { } bool FTconfigManager::storeSettings (const std::string &name, bool uselast) { if (!uselast && (name == "")) { return false; } wxString dirname (wxString::FromAscii (_basedir.c_str()) + wxFileName::GetPathSeparator()); // directory to store settings if (uselast) { dirname += wxT("last_setting"); } else { dirname += (wxString (wxT("presets")) + wxFileName::GetPathSeparator() + wxString::FromAscii(name.c_str())); } std::cout<< "storing setting '" << (name.empty() ? "(last setting)" : name) << "' to directory '" << static_cast (dirname.mb_str()) << "'" << std::endl; if ( ! wxDir::Exists(dirname) ) { if (mkdir ( dirname.fn_str(), 0755 )) { printf ("Error creating %s\n", static_cast (dirname.mb_str())); return false; } } FTioSupport * iosup = FTioSupport::instance(); // remove all of our files wxDir dir(dirname); if ( !dir.IsOpened() ) { return false; } wxString filename; bool cont = dir.GetFirst(&filename); while ( cont ) { //printf ("%s\n", filename.c_str()); unlink ( (dirname + wxFileName::GetPathSeparator() + filename).fn_str() ); cont = dir.GetNext(&filename); } // make xmltree XMLTree configdoc; XMLNode * rootNode = new XMLNode("Preset"); rootNode->add_property("version", freqtweak_version); configdoc.set_root (rootNode); // Params node has global dsp settings XMLNode * paramsNode = rootNode->add_child ("Params"); XMLNode * channelsNode = rootNode->add_child ("Channels"); for (int i=0; i < iosup->getActivePathCount(); i++) { FTprocessPath * procpath = iosup->getProcessPath(i); if (!procpath) continue; // shouldnt happen FTspectralEngine *engine = procpath->getSpectralEngine(); if (i==0) { // pull global params from first procpath paramsNode->add_property ("fft_size", static_cast (wxString::Format(wxT("%d"), engine->getFFTsize()).mb_str())); paramsNode->add_property ("windowing", static_cast (wxString::Format(wxT("%d"), engine->getWindowing()).mb_str())); paramsNode->add_property ("update_speed", static_cast (wxString::Format(wxT("%d"), engine->getUpdateSpeed()).mb_str())); paramsNode->add_property ("oversamp", static_cast (wxString::Format(wxT("%d"), engine->getOversamp()).mb_str())); paramsNode->add_property ("tempo", static_cast (wxString::Format(wxT("%d"), engine->getTempo()).mb_str())); paramsNode->add_property ("max_delay", static_cast (wxString::Format(wxT("%.10g"), engine->getMaxDelay()).mb_str())); } vector procmods; engine->getProcessorModules (procmods); XMLNode * chanNode = channelsNode->add_child ("Channel"); chanNode->add_property ("pos", static_cast (wxString::Format(wxT("%d"), i).mb_str())); chanNode->add_property ("input_gain", static_cast (wxString::Format(wxT("%.10g"), engine->getInputGain()).mb_str())); chanNode->add_property ("mix_ratio", static_cast (wxString::Format(wxT("%.10g"), engine->getMixRatio()).mb_str())); chanNode->add_property ("bypassed", static_cast (wxString::Format(wxT("%d"), engine->getBypassed() ? 1: 0).mb_str())); chanNode->add_property ("muted", static_cast (wxString::Format(wxT("%d"), engine->getMuted() ? 1 : 0).mb_str())); // now for the filter sections XMLNode * procmodsNode = chanNode->add_child ("ProcMods"); for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); XMLNode * pmNode = procmodsNode->add_child ("ProcMod"); pmNode->add_property ("pos", static_cast (wxString::Format(wxT("%d"), n).mb_str())); pmNode->add_property ("name", pm->getConfName()); for (unsigned int m=0; m < filts.size(); ++m) { XMLNode * filtNode = pmNode->add_child ("Filter"); filtNode->add_property ("pos", static_cast (wxString::Format(wxT("%d"), m).mb_str())); filtNode->add_property ("name", filts[m]->getConfigName().c_str()); filtNode->add_property ("linked", static_cast ( wxString::Format(wxT("%d"), filts[m]->getLink() ? filts[m]->getLink()->getId() : -1).mb_str())); filtNode->add_property ("bypassed", static_cast ( wxString::Format(wxT("%d"), filts[m]->getBypassed() ? 1 : 0).mb_str())); std::string filtfname ( (wxString::Format(wxT("%d_%d_"), i, n) + wxString::FromAscii (filts[m]->getConfigName().c_str()) + wxT(".filter")).fn_str() ); filtNode->add_property ("file", filtfname); // write out filter file wxTextFile filtfile (dirname + wxFileName::GetPathSeparator() + wxString::FromAscii (filtfname.c_str())); if (filtfile.Exists()) { // remove it unlink (wxString (filtfile.GetName()).fn_str ()); } filtfile.Create (); writeFilter (filts[m], filtfile); filtfile.Write(); filtfile.Close(); // write Extra node XMLNode * extran = filts[m]->getExtraNode(); filtNode->add_child_copy (*extran); } } // port connections XMLNode * inputsNode = chanNode->add_child ("Inputs"); const char ** inports = iosup->getConnectedInputPorts(i); if (inports) { for (int n=0; inports[n]; n++) { XMLNode * portNode = inputsNode->add_child ("Port"); portNode->add_property ("name", inports[n]); } free(inports); } XMLNode * outputsNode = chanNode->add_child ("Outputs"); const char ** outports = iosup->getConnectedOutputPorts(i); if (outports) { for (int n=0; outports[n]; n++) { XMLNode * portNode = outputsNode->add_child ("Port"); portNode->add_property ("name", outports[n]); } free(outports); } } // modulations XMLNode * modulationsNode = rootNode->add_child ("Modulators"); /* ... ... */ for (int i=0; i < iosup->getActivePathCount(); i++) { FTprocessPath * procpath = iosup->getProcessPath(i); if (!procpath) continue; // shouldnt happen FTspectralEngine *engine = procpath->getSpectralEngine(); vector mods; engine->getModulators (mods); for (vector::iterator miter = mods.begin(); miter != mods.end(); ++miter) { XMLNode *modNode = modulationsNode->add_child ("Modulator"); XMLNode *controlsNode = modNode->add_child ("Controls"); XMLNode *filtersNode = modNode->add_child ("Filters"); FTmodulatorI * mod = (*miter); modNode->add_property ("name", mod->getConfName().c_str()); modNode->add_property ("user_name", mod->getUserName().c_str()); modNode->add_property ("bypassed", static_cast (wxString::Format(wxT("%d"), mod->getBypassed() ? 1 : 0).mb_str())); modNode->add_property ("channel", static_cast (wxString::Format(wxT("%d"), i).mb_str())); // do the filters FTmodulatorI::SpecModList filters; mod->getSpecMods (filters); for (FTmodulatorI::SpecModList::iterator filtiter = filters.begin(); filtiter != filters.end(); ++filtiter) { int chan=0, modpos=0, filtpos=0; if (lookupFilterLocation ((*filtiter), chan, modpos, filtpos)) { XMLNode * filtNode = filtersNode->add_child ("Filter"); filtNode->add_property ("channel", static_cast (wxString::Format(wxT("%d"), chan).mb_str())); filtNode->add_property ("modpos", static_cast (wxString::Format(wxT("%d"), modpos).mb_str())); filtNode->add_property ("filtpos", static_cast (wxString::Format(wxT("%d"), filtpos).mb_str())); } } // do the controls FTmodulatorI::ControlList controls; mod->getControls (controls); for (FTmodulatorI::ControlList::iterator ctrliter = controls.begin(); ctrliter != controls.end(); ++ctrliter) { FTmodulatorI::Control * ctrl = (*ctrliter); XMLNode * ctrlNode = controlsNode->add_child ("Control"); ctrlNode->add_property ("name", ctrl->getConfName().c_str()); //ctrlNode->add_property ("type", static_cast (wxString::Format(wxT("%d"), (int) ctrl->getType()).mb_str())); //ctrlNode->add_property ("units", ctrl->getUnits().c_str()); if (ctrl->getType() == FTmodulatorI::Control::IntegerType) { int lb,ub,val; ctrl->getBounds (lb, ub); ctrl->getValue (val); //ctrlNode->add_property ("lower_bound", static_cast (wxString::Format(wxT("%d"), lb).mb_str())); //ctrlNode->add_property ("upper_bound", static_cast (wxString::Format(wxT("%d"), ub).mb_str())); ctrlNode->add_property ("value", static_cast (wxString::Format(wxT("%d"), val).mb_str())); } else if (ctrl->getType() == FTmodulatorI::Control::FloatType) { float lb,ub,val; ctrl->getBounds (lb, ub); ctrl->getValue (val); //ctrlNode->add_property ("lower_bound", static_cast (wxString::Format(wxT("%.10g"), lb).mb_str())); //ctrlNode->add_property ("upper_bound", static_cast (wxString::Format(wxT("%.10g"), ub).mb_str())); ctrlNode->add_property ("value", static_cast (wxString::Format(wxT("%.10g"), val).mb_str())); } else if (ctrl->getType() == FTmodulatorI::Control::BooleanType) { bool val; ctrl->getValue (val); modNode->add_property ("value", static_cast (wxString::Format(wxT("%d"), val ? 1 : 0).mb_str())); } else if (ctrl->getType() == FTmodulatorI::Control::StringType) { string val; ctrl->getValue (val); ctrlNode->add_property ("value", val.c_str()); } else if (ctrl->getType() == FTmodulatorI::Control::EnumType) { string val; list enumlist; ctrl->getValue (val); ctrl->getEnumStrings(enumlist); ctrlNode->add_property ("value", val.c_str()); // string enumstr; // for (list::iterator eiter=enumlist.begin(); eiter != enumlist.end(); ++eiter) { // if (eiter != enumlist.begin()) { // enumstr += ","; // } // enumstr += (*eiter); // } // ctrlNode->add_property ("enumlist", enumstr.c_str()); } } } } // write doc to file if (configdoc.write (static_cast ((dirname + wxFileName::GetPathSeparator() + wxT("config.xml")).fn_str()))) { fprintf (stderr, "Stored settings into %s\n", static_cast (dirname.fn_str())); return true; } else { fprintf (stderr, "Failed to store settings into %s\n", static_cast (dirname.fn_str())); return false; } } bool FTconfigManager::loadSettings (const std::string &name, bool restore_ports, bool uselast) { vector > tmpvec; return loadSettings(name, restore_ports, false, tmpvec, uselast); } bool FTconfigManager::loadSettings (const std::string &name, bool restore_ports, bool ignore_iosup, vector< vector > & procvec, bool uselast) { if (!uselast && (name == "")) { return false; } wxString dirname (wxString::FromAscii (_basedir.c_str()) + wxFileName::GetPathSeparator()); if (uselast) { dirname += wxT("last_setting"); } else { dirname += (wxString (wxT("presets")) + wxFileName::GetPathSeparator() + wxString::FromAscii (name.c_str())); } if ( ! wxDir::Exists(dirname) ) { printf ("Settings %s does not exist!\n", static_cast (dirname.fn_str())); return false; } FTioSupport * iosup = 0; if (!ignore_iosup) { iosup = FTioSupport::instance(); } // open file string configfname(static_cast ((dirname + wxFileName::GetPathSeparator() + wxT("config.xml")).fn_str() )); XMLTree configdoc (configfname); if (!configdoc.initialized()) { fprintf (stderr, "Error loading config at %s!\n", configfname.c_str()); return false; } XMLNode * rootNode = configdoc.root(); if (!rootNode || rootNode->name() != "Preset") { fprintf (stderr, "Preset root node not found in %s!\n", configfname.c_str()); return false; } // get channels XMLNode * channelsNode = find_named_node (rootNode, "Channels"); if (!channelsNode ) { fprintf (stderr, "Preset Channels node not found in %s!\n", configfname.c_str()); return false; } XMLNodeList chanlist = channelsNode->children(); if (chanlist.size() < 1) { fprintf (stderr, "No channels found in %s!\n", configfname.c_str()); return false; } if (!ignore_iosup) { unsigned int i; for (i=0; i < chanlist.size() && i < FT_MAXPATHS; i++) { iosup->setProcessPathActive(i, true); } // set all remaining paths inactive for ( ; i < FT_MAXPATHS; i++) { iosup->setProcessPathActive(i, false); } } else { // set up procvec with its channels for (unsigned int i=0; i < chanlist.size() && i < FT_MAXPATHS; i++) { procvec.push_back(vector()); } } // get global params unsigned long fft_size = 1024; unsigned long windowing = 0; unsigned long update_speed = 2; unsigned long oversamp = 4; unsigned long tempo = 120; double max_delay = 2.5; XMLNode * paramsNode = find_named_node (rootNode, "Params"); if (paramsNode) { XMLPropertyConstIterator propiter; XMLPropertyList proplist = paramsNode->properties(); for (propiter=proplist.begin(); propiter != proplist.end(); ++propiter) { string key = (*propiter)->name(); wxString value (wxString::FromAscii ((*propiter)->value().c_str())); if (key == "fft_size") { value.ToULong(&fft_size); } else if (key == "windowing") { value.ToULong(&windowing); } else if (key == "update_speed") { value.ToULong(&update_speed); } else if (key == "oversamp") { value.ToULong(&oversamp); } else if (key == "tempo") { value.ToULong(&tempo); } else if (key == "max_delay") { value.ToDouble(&max_delay); } } } _linkCache.clear(); // clear all procpaths XMLNodeConstIterator chaniter; XMLNode * chanNode; double fval; unsigned long uval; for (chaniter=chanlist.begin(); chaniter != chanlist.end(); ++chaniter) { chanNode = *chaniter; XMLProperty * prop; if (!(prop = chanNode->property ("pos"))) { fprintf (stderr, "pos missing in channel!\n"); continue; } unsigned long chan_pos; wxString tmpstr (wxString::FromAscii (prop->value().c_str())); if (!tmpstr.ToULong (&chan_pos) || chan_pos >= FT_MAXPATHS) { fprintf (stderr, "invalid pos in channel!\n"); continue; } FTspectralEngine * engine = 0; if (!ignore_iosup) { FTprocessPath * procpath = iosup->getProcessPath((int) chan_pos); if (!procpath) continue; // shouldnt happen engine = procpath->getSpectralEngine(); // apply some of the global settings now engine->setOversamp ((int) oversamp); engine->setTempo ((int) tempo); engine->setMaxDelay ((float) max_delay); // get channel settings XMLPropertyConstIterator propiter; XMLPropertyList proplist = chanNode->properties(); for (propiter=proplist.begin(); propiter != proplist.end(); ++propiter) { string key = (*propiter)->name(); wxString value (wxString::FromAscii ((*propiter)->value().c_str())); if (key == "input_gain") { if (value.ToDouble(&fval)) { engine->setInputGain ((float) fval); } } else if (key == "mix_ratio") { if (value.ToDouble(&fval)) { engine->setMixRatio ((float) fval); } } else if (key == "bypassed") { if (value.ToULong(&uval)) { engine->setBypassed (uval==1 ? true: false); } } else if (key == "muted") { if (value.ToULong(&uval)) { engine->setMuted (uval==1 ? true: false); } } } // clear existing procmods engine->clearProcessorModules(); } // get procmods node XMLNode * procmodsNode = find_named_node (chanNode, "ProcMods"); if ( !procmodsNode ) { fprintf (stderr, "Preset ProcMods node not found in %s!\n", configfname.c_str()); return false; } XMLNodeList pmlist = procmodsNode->children(); XMLNodeConstIterator pmiter; XMLNode * pmNode; for (pmiter=pmlist.begin(); pmiter != pmlist.end(); ++pmiter) { pmNode = *pmiter; if (pmNode->name() != "ProcMod") continue; if (!(prop = pmNode->property ("pos"))) { fprintf (stderr, "pos missing in procmod!\n"); continue; } unsigned long ppos; tmpstr = wxString::FromAscii (prop->value().c_str()); if (!tmpstr.ToULong (&ppos)) { fprintf (stderr, "invalid pos in procmod!\n"); continue; } if (!(prop = pmNode->property ("name"))) { fprintf (stderr, "name missing in procmod!\n"); continue; } string pmname = prop->value(); // construct new procmod FTprocI * procmod = FTdspManager::instance()->getModuleByConfigName(pmname); if (!procmod) { fprintf (stderr, "no proc module '%s' supported\n", pmname.c_str()); continue; } procmod = procmod->clone(); // must call this before initialization procmod->setMaxDelay ((float)max_delay); procmod->initialize(); if (!ignore_iosup) { procmod->setSampleRate (iosup->getSampleRate()); } procmod->setOversamp ((int)oversamp); // load up the filters in the procmod XMLNodeList filtlist = pmNode->children(); XMLNodeConstIterator filtiter; XMLNode * filtNode; for (filtiter=filtlist.begin(); filtiter != filtlist.end(); ++filtiter) { filtNode = *filtiter; if (filtNode->name() != "Filter") { continue; } if (!(prop =filtNode->property ("pos"))) { fprintf (stderr, "pos missing in filter!\n"); continue; } unsigned long fpos; tmpstr = wxString::FromAscii (prop->value().c_str()); if (!tmpstr.ToULong (&fpos)) { fprintf (stderr, "invalid filter pos in channel!\n"); continue; } if (!(prop = filtNode->property ("file"))) { fprintf (stderr, "filter filename missing in procmod!\n"); continue; } std::string filtfname = prop->value(); FTspectrumModifier * specmod = procmod->getFilter (fpos); if (!specmod) { fprintf (stderr, "no filter at index %lu in procmod!\n", fpos); continue; } // load filter wxTextFile filtfile (dirname + wxFileName::GetPathSeparator() + wxString::Format (wxT("%d_"), (int) chan_pos) + wxString::Format (wxT("%d_"), (int) ppos) + wxString::FromAscii (specmod->getConfigName().c_str()) + wxT(".filter")); if (filtfile.Open()) { loadFilter (specmod, filtfile); filtfile.Close(); } // set bypassed if ((prop = filtNode->property ("bypassed"))) { wxString value (wxString::FromAscii (prop->value().c_str())); if (value.ToULong(&uval)) { specmod->setBypassed (uval==1 ? true: false); } } // actual linkage must wait for later long linked = -1; if ((prop = filtNode->property ("linked"))) { wxString value (wxString::FromAscii (prop->value().c_str())); if (value.ToLong(&linked) && linked >= 0) { _linkCache.push_back (LinkCache(chan_pos, linked, ppos, fpos)); } else { specmod->unlink(false); } } // extra node XMLNode * extraNode = find_named_node (filtNode, "Extra"); if (extraNode) { specmod->setExtraNode (extraNode); } } // insert procmod if (!ignore_iosup) { engine->insertProcessorModule (procmod, ppos); } else { // add to vector in the right spot vector::iterator iter = procvec[chan_pos].begin(); for (unsigned int n=0; n < ppos && iter!=procvec[chan_pos].end(); ++n) { ++iter; } procvec[chan_pos].insert (iter, procmod); } } if (ignore_iosup) { // can skip to the next one continue; } // apply global settings engine->setFFTsize ((FTspectralEngine::FFT_Size) fft_size); engine->setWindowing ((FTspectralEngine::Windowing) windowing); engine->setUpdateSpeed ((FTspectralEngine::UpdateSpeed)(int) update_speed); // input ports if (restore_ports) { XMLNode * inputsNode = find_named_node (chanNode, "Inputs"); if (inputsNode ) { XMLNodeList portlist = inputsNode->children(); XMLNodeConstIterator portiter; iosup->disconnectPathInput(chan_pos, NULL); // disconnect all for (portiter = portlist.begin(); portiter != portlist.end(); ++portiter) { XMLNode * port = *portiter; if (port->name() == "Port") { XMLProperty * prop = port->property("name"); if (prop) { iosup->connectPathInput(chan_pos, prop->value().c_str()); } } } } else { fprintf (stderr, "channel inputs node not found in %s!\n", configfname.c_str()); } // output ports XMLNode * outputsNode = find_named_node (chanNode, "Outputs"); if (inputsNode ) { XMLNodeList portlist = outputsNode->children(); XMLNodeConstIterator portiter; iosup->disconnectPathOutput(chan_pos, NULL); // disconnect all for (portiter = portlist.begin(); portiter != portlist.end(); ++portiter) { XMLNode * port = *portiter; if (port->name() == "Port") { XMLProperty * prop = port->property("name"); if (prop) { iosup->connectPathOutput(chan_pos, prop->value().c_str()); } } } } else { fprintf (stderr, "channel outputs node not found in %s!\n", configfname.c_str()); } } // // TEMPORARY // FTprocI * firstproc = engine->getProcessorModule(0); // if (firstproc) { // FTmodulatorI * modul = FTmodulatorManager::instance()->getModuleByConfigName("Shift")->clone(); // modul->initialize(); // modul->addSpecMod (firstproc->getFilter(0)); // engine->appendModulator(modul); // } } // Modulations // clear all modulators from all engines for (int i=0; i < FTioSupport::instance()->getActivePathCount(); i++) { FTprocessPath * procpath = FTioSupport::instance()->getProcessPath(i); if (procpath) { FTspectralEngine *engine = procpath->getSpectralEngine(); engine->clearModulators (); } } XMLNode * modulatorsNode = find_named_node (rootNode, "Modulators"); if ( modulatorsNode ) { loadModulators (modulatorsNode); } if (!ignore_iosup) { // now we can apply linkages list::iterator liter; for (liter = _linkCache.begin(); liter != _linkCache.end(); ++liter) { LinkCache & lc = *liter; FTspectrumModifier *source = iosup->getProcessPath(lc.source_chan)->getSpectralEngine() ->getProcessorModule(lc.mod_n)->getFilter(lc.filt_n); FTspectrumModifier *dest = iosup->getProcessPath(lc.dest_chan)->getSpectralEngine() ->getProcessorModule(lc.mod_n)->getFilter(lc.filt_n); if (dest && source) { source->link (dest); } else { fprintf(stderr, "could not link! source or dest does not exist!\n"); } } } else { // just use the stored ones list::iterator liter; for (liter = _linkCache.begin(); liter != _linkCache.end(); ++liter) { LinkCache & lc = *liter; FTspectrumModifier *source = procvec[lc.source_chan][lc.mod_n]->getFilter(lc.filt_n); FTspectrumModifier *dest = procvec[lc.dest_chan][lc.mod_n]->getFilter(lc.filt_n); source->link (dest); } } return true; } void FTconfigManager::loadModulators (const XMLNode * modulatorsNode) { XMLNodeList modlist = modulatorsNode->children(); XMLNodeConstIterator moditer; XMLNode * modNode; XMLProperty * prop; wxString tmpstr; for (moditer=modlist.begin(); moditer != modlist.end(); ++moditer) { modNode = *moditer; if (modNode->name() != "Modulator") continue; if (!(prop = modNode->property ("name"))) { fprintf (stderr, "name missing in modulator!\n"); continue; } string modname = prop->value(); string usermodname; if (!(prop = modNode->property ("user_name"))) { fprintf (stderr, "user_name missing in modulator!\n"); } else { usermodname = prop->value(); } bool bypass = false; if (!(prop = modNode->property ("bypassed"))) { fprintf (stderr, "bypassed missing in modulator!\n"); } else { unsigned long bypassi = 0; tmpstr = wxString::FromAscii (prop->value().c_str()); if (!tmpstr.ToULong (&bypassi)) { fprintf (stderr, "invalid bypass flag in modulator!\n"); } bypass = (bypassi==0 ? false: true); } long channel = -1; if (!(prop = modNode->property ("channel"))) { fprintf (stderr, "channel missing in modulator!\n"); } else { tmpstr = wxString::FromAscii (prop->value().c_str()); if (!tmpstr.ToLong (&channel)) { fprintf (stderr, "invalid channel in modulator!\n"); } } // create the modulator FTmodulatorI * protomod = FTmodulatorManager::instance()->getModuleByConfigName (modname); if (!protomod) { fprintf (stderr, "module %s could not be found\n", modname.c_str()); continue; } FTmodulatorI * mod = protomod->clone(); mod->initialize(); mod->setUserName (usermodname); mod->setBypassed (bypass); // get all controls from real one FTmodulatorI::ControlList ctrllist; mod->getControls (ctrllist); // now do controls XMLNode * modControlsNode = find_named_node (modNode, "Controls"); if (modControlsNode) { XMLNodeList modctrllist = modControlsNode->children(); XMLNodeConstIterator modctrliter; XMLNode * ctrlNode; for (modctrliter=modctrllist.begin(); modctrliter != modctrllist.end(); ++modctrliter) { ctrlNode = *modctrliter; if (ctrlNode->name() != "Control") continue; if (!(prop = ctrlNode->property ("name"))) { fprintf (stderr, "name missing in modulator control!\n"); continue; } string ctrlname = prop->value(); // lookup control by name for (FTmodulatorI::ControlList::iterator citer = ctrllist.begin(); citer != ctrllist.end(); ++citer) { FTmodulatorI::Control * ctrl = (*citer); if (ctrl->getConfName() == ctrlname) { if (ctrl->getType() == FTmodulatorI::Control::IntegerType) { long intval = 0; if (!(prop = ctrlNode->property ("value"))) { fprintf (stderr, "int value missing in modulator control!\n"); } else { tmpstr = wxString::FromAscii (prop->value().c_str()); if (!tmpstr.ToLong (&intval)) { fprintf (stderr, "invalid value in modulator control!\n"); } else { ctrl->setValue ((int)intval); } } } else if (ctrl->getType() == FTmodulatorI::Control::FloatType) { double fval = 0; if (!(prop = ctrlNode->property ("value"))) { fprintf (stderr, "float value missing in modulator control!\n"); } else { tmpstr = wxString::FromAscii (prop->value().c_str()); if (!tmpstr.ToDouble (&fval)) { fprintf (stderr, "invalid value in modulator control!\n"); } else { ctrl->setValue ((float)fval); } } } else if (ctrl->getType() == FTmodulatorI::Control::StringType || ctrl->getType() == FTmodulatorI::Control::EnumType) { if (!(prop = ctrlNode->property ("value"))) { fprintf (stderr, "string enum value missing in modulator control!\n"); } else { string valstr = prop->value(); ctrl->setValue(valstr); } } else if (ctrl->getType() == FTmodulatorI::Control::BooleanType) { long intval = 0; if (!(prop = ctrlNode->property ("value"))) { fprintf (stderr, "bool value missing in modulator control!\n"); } else { tmpstr = wxString::FromAscii (prop->value().c_str()); if (!tmpstr.ToLong (&intval)) { fprintf (stderr, "invalid value in modulator control!\n"); } else { ctrl->setValue ((intval == 0 ? false : true)); } } } break; } } } } else { fprintf (stderr, "module controls node could not be found\n"); } // link to filters XMLNode * modFiltersNode = find_named_node (modNode, "Filters"); if (modFiltersNode) { XMLNodeList filtlist = modFiltersNode->children(); XMLNodeConstIterator filtiter; XMLNode * filtNode; for (filtiter=filtlist.begin(); filtiter != filtlist.end(); ++filtiter) { filtNode = *filtiter; if (filtNode->name() != "Filter") continue; unsigned long filtchan = 0; if (!(prop = filtNode->property ("channel"))) { fprintf (stderr, "int value missing in modulator filter channel!\n"); continue; } tmpstr = wxString::FromAscii (prop->value().c_str()); if (!tmpstr.ToULong (&filtchan)) { fprintf (stderr, "invalid channel value in modulator filter control!\n"); continue; } unsigned long modpos = 0; if (!(prop = filtNode->property ("modpos"))) { fprintf (stderr, "int value missing in modulator filter pos!\n"); continue; } tmpstr = wxString::FromAscii (prop->value().c_str()); if (!tmpstr.ToULong (&modpos)) { fprintf (stderr, "invalid modpos value in modulator filter pos control!\n"); continue; } unsigned long filtpos = 0; if (!(prop = filtNode->property ("filtpos"))) { fprintf (stderr, "int value missing in modulator filter pos!\n"); continue; } tmpstr = wxString::FromAscii (prop->value().c_str()); if (!tmpstr.ToULong (&filtpos)) { fprintf (stderr, "invalid channel value in modulator filter pos control!\n"); continue; } // finally look it up FTspectrumModifier * specmod = lookupFilter (filtchan, modpos, filtpos); if (specmod) { mod->addSpecMod (specmod); } } } // add it to proper spectral engine if (channel > -1) { FTprocessPath * procpath = FTioSupport::instance()->getProcessPath(channel); if (procpath) { FTspectralEngine *engine = procpath->getSpectralEngine(); engine->appendModulator (mod); } else { delete mod; } } else { // for NOW, just delete it delete mod; } } } void FTconfigManager::loadFilter (FTspectrumModifier *specmod, wxTextFile & tf) { // FORMAT FOR FILTER FILES // ----------------------- // // One line per bin description, a bin description is: // [start_bin:stop_bin] value // // If the optional bin range is missing (one token in line) then // the value is assigned to the bin following the most recently filled bin. // The bin indexes start from 0 and the ranges are inclusive float *values = specmod->getValues(); // parse lines from it wxString line; line = tf.GetFirstLine(); int lastbin = -1; double val; unsigned long sbin, ebin; for ( unsigned int i =0; i < tf.GetLineCount(); i++ ) { line = tf[i]; line.Trim(true); line.Trim(false); if (line.IsEmpty() || line.GetChar(0) == '#') { continue; // ignore } // look for whitespace separating two possible tokens wxString rangestr; wxString value; int pos = line.find_first_of (wxT(" \t")); if (pos >= 0) { rangestr = line.substr(0, pos); value = line.Mid(pos).Strip(wxString::both); // printf ("rangestr is %s, value is %s\n", rangestr.c_str(), value.c_str()); if (rangestr.BeforeFirst(':').ToULong(&sbin) && rangestr.AfterFirst(':').ToULong(&ebin)) { for (unsigned int j=sbin; j <=ebin; j++) { if (value.ToDouble(&val)) { values[j] = (float) val; } } lastbin = ebin; } } else { // just value value = line; lastbin += 1; // printf ("bin=%d value is %s\n", lastbin, value.c_str()); if (value.ToDouble(&val)) { values[lastbin] = (float) val; } } } } void FTconfigManager::writeFilter (FTspectrumModifier *specmod, wxTextFile & tf) { // FORMAT FOR FILTER FILES // ----------------------- // // One line per bin description, a bin description is: // [start_bin:stop_bin] value // // If the optional bin range is missing (one token in line) then // the value is assigned to the bin following the most recently filled bin. // The bin indexes start from 0 and the ranges are inclusive float * values = specmod->getValues(); int totbins = specmod->getLength(); int pos = 0; int i; float lastval = values[0]; for (i = 1; i < totbins; i++) { // if (wxString::Format("%.10g", values[i]) == wxString::Format("%.20g", lastval)) { if (values[i] == lastval) { continue; } else if (i == pos + 1 ) { // just write last number tf.AddLine ( wxString::Format (wxT("%.20g"), lastval)); pos = i; lastval = values[i]; } else { // write range tf.AddLine ( wxString::Format (wxT("%d:%d %.20g"), pos, i-1, values[pos])); pos = i; lastval = values[i]; } } // write last if (pos < totbins) { tf.AddLine ( wxString::Format (wxT("%d:%d %.20g"), pos, totbins-1, values[pos])); } } list FTconfigManager::getSettingsNames() { wxString dirname (wxString::FromAscii(_basedir.c_str()) + wxFileName::GetPathSeparator() + wxT("presets")); list flist; wxDir dir(dirname); if ( !dir.IsOpened() ) { return flist; } wxString filename; bool cont = dir.GetFirst(&filename, wxT(""), wxDIR_DIRS); while ( cont ) { //printf ("%s\n", filename.c_str()); flist.push_back (static_cast (filename.fn_str())); cont = dir.GetNext(&filename); } return flist; } XMLNode * FTconfigManager::find_named_node (const XMLNode * node, string name) { XMLNodeList nlist; XMLNodeConstIterator niter; XMLNode* child; nlist = node->children(); for (niter = nlist.begin(); niter != nlist.end(); ++niter) { child = *niter; if (child->name() == name) { return child; } } return 0; } bool FTconfigManager::lookupFilterLocation (FTspectrumModifier * specmod, int & chan, int & modpos, int & filtpos) { // brute force FTioSupport * iosup = FTioSupport::instance(); bool done = false; for (int i=0; i < iosup->getActivePathCount(); i++) { FTprocessPath * procpath = iosup->getProcessPath(i); if (!procpath) continue; // shouldnt happen FTspectralEngine *engine = procpath->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); for (unsigned int m=0; m < filts.size(); ++m) { if (specmod == filts[m]) { chan = i; modpos = n; filtpos = m; done = true; goto done; } } } } done: return done; } FTspectrumModifier * FTconfigManager::lookupFilter (int chan, int modpos, int filtpos) { FTioSupport * iosup = FTioSupport::instance(); FTprocessPath * procpath = iosup->getProcessPath(chan); if (procpath) { FTspectralEngine *engine = procpath->getSpectralEngine(); FTprocI * procmod = engine->getProcessorModule (modpos); if (procmod) { FTspectrumModifier * specmod = procmod->getFilter (filtpos); return specmod; } } return 0; } freqtweak-0.7.2/src/FTconfigManager.hpp0000644000175200017520000000445611226173741017004 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTCONFIGMANAGER_HPP__ #define __FTCONFIGMANAGER_HPP__ #include #include #include "FTtypes.hpp" #include #include #include using namespace std; class FTspectralEngine; class FTspectrumModifier; class XMLNode; class FTprocI; class FTconfigManager { public: FTconfigManager(const std::string &basedir = ""); virtual ~FTconfigManager(); bool storeSettings (const std::string &name, bool uselast=false); bool loadSettings (const std::string &name, bool restore_ports=false, bool uselast=false); bool loadSettings (const std::string &name, bool restore_ports, bool ignore_iosup, vector > & procvec, bool uselast); list getSettingsNames(); protected: void writeFilter (FTspectrumModifier *specmod, wxTextFile & tf); void loadFilter (FTspectrumModifier *specmod, wxTextFile & tf); bool lookupFilterLocation (FTspectrumModifier * specmod, int & chan, int & modpos, int & filtpos); FTspectrumModifier * lookupFilter (int chan, int modpos, int filtpos); void loadModulators (const XMLNode * modulatorsNode); XMLNode* find_named_node (const XMLNode * node, string name); std::string _basedir; class LinkCache { public: LinkCache (unsigned int src, unsigned int dest, unsigned int modn, unsigned int filtn) : source_chan(src), dest_chan(dest), mod_n(modn), filt_n(filtn) {} unsigned int source_chan; unsigned int dest_chan; unsigned int mod_n; unsigned int filt_n; }; list _linkCache; }; #endif freqtweak-0.7.2/src/FTmainwin.cpp0000644000175200017520000032607611226174254015706 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" // for all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWindows headers #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include #include #include #include #include #include #include #include #include using namespace std; #include "FTmainwin.hpp" #include "FTspectragram.hpp" #include "FTioSupport.hpp" #include "FTprocessPath.hpp" #include "FTprocI.hpp" #include "FTspectralEngine.hpp" #include "FTactiveBarGraph.hpp" #include "FTportSelectionDialog.hpp" #include "FTspectrumModifier.hpp" #include "FTconfigManager.hpp" #include "FTupdateToken.hpp" #include "FTprocOrderDialog.hpp" #include "FTpresetBlendDialog.hpp" #include "FTmodulatorDialog.hpp" #include "FThelpWindow.hpp" #include "pix_button.hpp" using namespace JLCui; #include "version.h" #include "ftlogo.xpm" //#include "images/bypass.xpm" //#include "images/bypass_active.xpm" //#include "images/link.xpm" //#include "images/link_active.xpm" #include "pixmap_includes.hpp" // ---------------------------------------------------------------------------- // event tables and other macros for wxWindows // ---------------------------------------------------------------------------- // IDs for the controls and the menu commands enum WindowIds { // menu items FT_QuitMenu = 1, FT_AboutMenu, FT_ProcModMenu, FT_PresetBlendMenu, FT_ModulatorMenu, FT_HelpTipsMenu, FT_InputButtonId, FT_OutputButtonId, FT_InSpecTypeId, FT_OutSpecTypeId, FT_BypassBase = 100, FT_InSpecLabelId = 130, FT_OutSpecLabelId, FT_LabelBase = 150, FT_LinkBase = 180, FT_FreqBinsChoiceId = 210, FT_OverlapChoiceId, FT_WindowingChoiceId, FT_TimescaleSliderId, FT_FreqScaleChoiceId, FT_RowPanelId, FT_RowPanel, FT_BypassId, FT_MuteId, FT_GainSlider, FT_GainSpin, FT_MixSlider, FT_PathCountChoice, FT_StoreButton, FT_LoadButton, FT_PresetCombo, FT_PlotSpeedChoiceId, FT_PlotSuperSmoothId, FT_MixLinkedButton, FT_IOreconnectButton, FT_IOdisconnectButton, FT_IOnameText, FT_GridBase = 500, FT_GridSnapBase = 530, FT_MaxDelayChoiceId = 560, FT_TempoSpinId, FT_RestorePortCheckId }; DEFINE_LOCAL_EVENT_TYPE (FT_EVT_TITLEMENU_COMMAND); IMPLEMENT_DYNAMIC_CLASS(FTtitleMenuEvent, wxCommandEvent); // the event tables connect the wxWindows events with the functions (event // handlers) which process them. It can be also done at run-time, but for the // simple menu events like this the static method is much simpler. BEGIN_EVENT_TABLE(FTmainwin, wxFrame) // EVT_SIZE(FTmainwin::OnSize) EVT_MENU(FT_QuitMenu, FTmainwin::OnQuit) EVT_MENU(FT_AboutMenu, FTmainwin::OnAbout) EVT_MENU(FT_HelpTipsMenu, FTmainwin::OnAbout) EVT_MENU(FT_ProcModMenu, FTmainwin::OnProcMod) EVT_MENU(FT_PresetBlendMenu, FTmainwin::OnPresetBlend) EVT_MENU(FT_ModulatorMenu, FTmainwin::OnModulatorDialog) EVT_IDLE(FTmainwin::OnIdle) EVT_CLOSE(FTmainwin::OnClose) EVT_BUTTON(FT_InputButtonId, FTmainwin::handleInputButton) EVT_BUTTON(FT_OutputButtonId, FTmainwin::handleOutputButton) EVT_BUTTON(FT_LinkBase, FTmainwin::handleLinkButtons) EVT_BUTTON(FT_BypassBase, FTmainwin::handleBypassButtons) EVT_CHOICE(FT_FreqBinsChoiceId, FTmainwin::handleChoices) EVT_CHOICE(FT_OverlapChoiceId, FTmainwin::handleChoices) EVT_CHOICE(FT_WindowingChoiceId, FTmainwin::handleChoices) EVT_CHOICE(FT_PlotSpeedChoiceId, FTmainwin::handleChoices) EVT_CHECKBOX(FT_PlotSuperSmoothId, FTmainwin::handleChoices) EVT_CHOICE(FT_MaxDelayChoiceId, FTmainwin::handleChoices) EVT_CHOICE(FT_PathCountChoice, FTmainwin::handlePathCount) EVT_COMMAND_SCROLL(FT_MixSlider, FTmainwin::handleMixSlider) EVT_SPINCTRL(FT_GainSpin, FTmainwin::handleGain) EVT_SASH_DRAGGED(FT_RowPanelId, FTmainwin::handleSashDragged) EVT_BUTTON(FT_InSpecLabelId, FTmainwin::handleLabelButtons) EVT_BUTTON(FT_LabelBase, FTmainwin::handleLabelButtons) EVT_BUTTON(FT_OutSpecLabelId, FTmainwin::handleLabelButtons) EVT_BUTTON(FT_InSpecTypeId, FTmainwin::handlePlotTypeButtons) EVT_BUTTON(FT_OutSpecTypeId, FTmainwin::handlePlotTypeButtons) EVT_CHECKBOX(FT_BypassId, FTmainwin::handleBypassButtons) EVT_CHECKBOX(FT_MuteId, FTmainwin::handleBypassButtons) EVT_BUTTON(FT_StoreButton, FTmainwin::handleStoreButton) EVT_BUTTON(FT_LoadButton, FTmainwin::handleLoadButton) EVT_CHECKBOX(FT_MixLinkedButton, FTmainwin::handleLinkButtons) EVT_BUTTON(FT_IOreconnectButton, FTmainwin::handleIOButtons) EVT_BUTTON(FT_IOdisconnectButton, FTmainwin::handleIOButtons) EVT_BUTTON(FT_GridBase, FTmainwin::handleGridButtons) EVT_BUTTON(FT_GridSnapBase, FTmainwin::handleGridButtons) EVT_SPINCTRL(FT_TempoSpinId, FTmainwin::handleSpins) EVT_TITLEMENU_COMMAND (0, FTmainwin::handleTitleMenuCmd) END_EVENT_TABLE() // ---------------------------------------------------------------------------- // main frame // ---------------------------------------------------------------------------- FTmainwin::FTmainwin(int startpath, const wxString& title, const wxString& rcdir, const wxPoint& pos, const wxSize& size) : wxFrame((wxFrame *)NULL, -1, title, pos, size), _startpaths(startpath), _inspecShown(true), _outspecShown(true), _linkedMix(true), _updateMS(10), _superSmooth(false), _refreshMS(200), _pathCount(startpath), _configManager(static_cast (rcdir.fn_str())), _procmodDialog(0), _blendDialog(0), _modulatorDialog(0), _titleFont(10, wxDEFAULT, wxNORMAL, wxBOLD), _titleAltFont(10, wxDEFAULT, wxSLANT, wxBOLD), _buttFont(10, wxDEFAULT, wxNORMAL, wxNORMAL) { _eventTimer = new FTupdateTimer(this); _refreshTimer = new FTrefreshTimer(this); for (int i=0; i < FT_MAXPATHS; i++) { _processPath[i] = 0; _updateTokens[i] = new FTupdateToken(); } buildGui(); } void FTmainwin::normalizeFontSize(wxFont & fnt, int height, wxString fitstr) { int fontw, fonth, desch, lead, lasth=0; GetTextExtent(fitstr, &fontw, &fonth, &desch, &lead, &fnt); //printf ("Text extent for %s: %d %d %d %d sz: %d\n", fitstr.c_str(), fontw, desch, lead, fonth, fnt.GetPointSize()); while (fonth > height ) { fnt.SetPointSize(fnt.GetPointSize() - 1); GetTextExtent(fitstr, &fontw, &fonth, &desch, &lead, &fnt); //printf ("Text extent for buttfont: %d %d %d %d sz: %d\n", fontw, fonth, desch, lead, fnt.GetPointSize()); if (lasth == fonth) break; // safety lasth = fonth; } } void FTmainwin::buildGui() { _bwidth = 22; _labwidth = 74; _bheight = 24; _rowh = 68; normalizeFontSize(_buttFont, _bheight-8, wxT("BA")); normalizeFontSize(_titleFont, _bheight-8, wxT("EQ")); normalizeFontSize(_titleAltFont, _bheight-8, wxT("EQ")); // set the frame icon //SetIcon(wxICON(mondrian)); // create a menu bar wxMenu *menuFile = new wxMenu(wxT(""), wxMENU_TEAROFF); menuFile->Append(FT_ProcModMenu, wxT("&DSP Modules...\tCtrl-P"), wxT("Configure DSP modules")); menuFile->Append(FT_ModulatorMenu, wxT("&Modulators...\tCtrl-M"), wxT("Configure Modulations")); menuFile->Append(FT_PresetBlendMenu, wxT("Preset &Blend...\tCtrl-B"), wxT("Blend multiple presets")); menuFile->AppendSeparator(); menuFile->Append(FT_QuitMenu, wxT("&Quit\tCtrl-Q"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(menuFile, wxT("&Control")); wxMenu *menuHelp = new wxMenu(wxT(""), wxMENU_TEAROFF); menuHelp->Append(FT_HelpTipsMenu, wxT("&Usage Tips...\tCtrl-H"), wxT("Show Usage Tips window")); menuHelp->Append(FT_AboutMenu, wxT("&About...\tCtrl-A"), wxT("Show about dialog")); menuBar->Append(menuHelp, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); #if wxUSE_STATUSBAR // create a status bar just for fun (with 3 panes) CreateStatusBar(3); SetStatusText(wxT("FreqTweak"), 0); #endif // wxUSE_STATUSBAR // terrible! _defaultBg = GetBackgroundColour(); //_activeBg.Set (254,185,55); _activeBg.Set (246,229,149); // get processPaths from jacksupport FTioSupport * iosup = FTioSupport::instance(); for (int i=0; i < _startpaths; i++) { // add to io support instance _processPath[i] = iosup->setProcessPathActive (i, true); } wxBoxSizer *mainsizer = new wxBoxSizer(wxVERTICAL); // overall controls wxNotebook * ctrlbook = new wxNotebook(this,-1, wxDefaultPosition, wxSize(-1, 70)); // preset panel wxPanel * configpanel = new wxPanel (ctrlbook, -1); wxBoxSizer *configSizer = new wxBoxSizer(wxHORIZONTAL); _presetCombo = new wxComboBox (configpanel, FT_PresetCombo, wxT(""), wxDefaultPosition, wxSize(200,-1), 0, 0, wxCB_SORT); configSizer->Add( _presetCombo, 0, wxALL|wxALIGN_CENTER, 2); wxButton *storeButt = new wxButton(configpanel, FT_StoreButton, wxT("Store")); configSizer->Add( storeButt, 0, wxALL|wxALIGN_CENTER, 2); wxButton *loadButt = new wxButton(configpanel, FT_LoadButton, wxT("Load")); configSizer->Add( loadButt, 0, wxALL|wxALIGN_CENTER, 2); _restorePortsCheck = new wxCheckBox(configpanel, FT_RestorePortCheckId, wxT("Restore Ports")); configSizer->Add( _restorePortsCheck, 0, wxALL|wxALIGN_CENTER, 2); configpanel->SetAutoLayout(TRUE); configSizer->Fit( configpanel ); configpanel->SetSizer(configSizer); ctrlbook->AddPage ( (wxNotebookPage *) configpanel, wxT("Presets"), true); //mainsizer->Add (configSizer, 0, wxALL|wxEXPAND, 1); wxPanel * fftpanel = new wxPanel(ctrlbook, -1); wxStaticText *stattext; //wxBoxSizer *specCtrlSizer = new wxStaticBoxSizer(new wxStaticBox(fftpanel, -1, "FFT Params"), wxHORIZONTAL); wxBoxSizer *specCtrlSizer = new wxBoxSizer(wxHORIZONTAL); stattext = new wxStaticText(fftpanel, -1, wxT("Freq Bands")); specCtrlSizer->Add (stattext, 0, wxALIGN_CENTER|wxLEFT, 4); _freqBinsChoice = new wxChoice(fftpanel, FT_FreqBinsChoiceId); const int * fftbins = FTspectralEngine::getFFTSizes(); for (int i=0; i < FTspectralEngine::getFFTSizeCount(); i++) { _freqBinsChoice->Append(wxString::Format(wxT("%d"), fftbins[i] / 2), (void *) ((intptr_t)fftbins[i])); } specCtrlSizer->Add(_freqBinsChoice, 0, wxALL|wxALIGN_CENTER, 2); stattext = new wxStaticText(fftpanel, -1, wxT("Overlap")); specCtrlSizer->Add ( stattext, 0, wxALIGN_CENTER|wxLEFT, 4); _overlapChoice = new wxChoice(fftpanel, FT_OverlapChoiceId); _overlapChoice->Append(wxT("0 %"), (void *) 1); _overlapChoice->Append(wxT("50 %"), (void *) 2); _overlapChoice->Append(wxT("75 %"), (void *) 4); _overlapChoice->Append(wxT("87.5 %"), (void *) 8); _overlapChoice->Append(wxT("93.75 %"), (void *) 16); _overlapChoice->SetSelection(2); // hack specCtrlSizer->Add(_overlapChoice, 0, wxALL|wxALIGN_CENTER, 2); stattext = new wxStaticText(fftpanel, -1, wxT("Window")); specCtrlSizer->Add ( stattext, 0, wxALIGN_CENTER|wxLEFT, 4); _windowingChoice = new wxChoice(fftpanel, FT_WindowingChoiceId, wxDefaultPosition, wxSize(100,-1)); const char ** winstrs = FTspectralEngine::getWindowStrings(); for (int i=0; i < FTspectralEngine::getWindowStringsCount(); i++) { #if wxUSE_WCHAR_T wchar_t wstr[1024]; // FIXME: no idea how good this size is wxMB2WC (wstr, winstrs[i], 1024); _windowingChoice->Append(wstr); #else _windowingChoice->Append(winstrs[i]); #endif } _windowingChoice->SetSelection(0); specCtrlSizer->Add(_windowingChoice, 0, wxALL|wxALIGN_CENTER, 2); fftpanel->SetAutoLayout(TRUE); specCtrlSizer->Fit( fftpanel ); fftpanel->SetSizer(specCtrlSizer); ctrlbook->AddPage ( (wxNotebookPage *) fftpanel, wxT("FFT")); // plot page wxPanel * plotpanel = new wxPanel (ctrlbook, -1); wxBoxSizer *plotSizer = new wxBoxSizer(wxHORIZONTAL); stattext = new wxStaticText(plotpanel, -1, wxT("Speed")); plotSizer->Add ( stattext, 0, wxALIGN_CENTER|wxLEFT, 4); _plotSpeedChoice = new wxChoice(plotpanel, FT_PlotSpeedChoiceId, wxDefaultPosition, wxSize(100,-1)); _plotSpeedChoice->Append(wxT("Turtle"), (void *) FTspectralEngine::SPEED_TURTLE); _plotSpeedChoice->Append(wxT("Slow"), (void *) FTspectralEngine::SPEED_SLOW); _plotSpeedChoice->Append(wxT("Medium"), (void *) FTspectralEngine::SPEED_MED); _plotSpeedChoice->Append(wxT("Fast"), (void *) FTspectralEngine::SPEED_FAST); //_plotSpeedChoice->SetSelection(2); // hack plotSizer->Add(_plotSpeedChoice, 0, wxALL|wxALIGN_CENTER, 2); _superSmoothCheck = new wxCheckBox (plotpanel, FT_PlotSuperSmoothId, wxT("Extra smooth but expensive")); _superSmoothCheck->SetValue(false); plotSizer->Add (_superSmoothCheck, 0, wxALL|wxALIGN_CENTER, 2); plotpanel->SetAutoLayout(TRUE); plotSizer->Fit( plotpanel ); plotpanel->SetSizer(plotSizer); ctrlbook->AddPage ( (wxNotebookPage *) plotpanel, wxT("Plots"), false); // IO page wxPanel * iopanel = new wxPanel (ctrlbook, -1); wxBoxSizer *ioSizer = new wxBoxSizer(wxHORIZONTAL); stattext = new wxStaticText(iopanel, -1, wxT("JACK-Name")); ioSizer->Add ( stattext, 0, wxALIGN_CENTER|wxLEFT, 4); _ioNameText = new wxTextCtrl (iopanel, FT_IOnameText, wxT(""), wxDefaultPosition, wxSize(150,-1)); ioSizer->Add (_ioNameText, 0, wxALL|wxALIGN_CENTER, 2); wxButton * reconnButton = new wxButton(iopanel, FT_IOreconnectButton, wxT("Reconnect As")); ioSizer->Add (reconnButton, 0, wxALL|wxALIGN_CENTER, 2); wxButton * disconnButton = new wxButton(iopanel, FT_IOdisconnectButton, wxT("Disconnect")); ioSizer->Add (disconnButton, 0, wxALL|wxALIGN_CENTER, 2); iopanel->SetAutoLayout(TRUE); ioSizer->Fit( iopanel ); iopanel->SetSizer(ioSizer); ctrlbook->AddPage ( (wxNotebookPage *) iopanel, wxT("I/O"), false); // time/memory page wxPanel * timepanel = new wxPanel (ctrlbook, -1); wxBoxSizer *timeSizer = new wxBoxSizer(wxHORIZONTAL); stattext = new wxStaticText(timepanel, -1, wxT("Max Delay Time")); timeSizer->Add ( stattext, 0, wxALIGN_CENTER|wxLEFT, 4); _maxDelayChoice = new wxChoice(timepanel, FT_MaxDelayChoiceId, wxDefaultPosition, wxSize(100,-1)); _maxDelayChoice->Append(wxT("0.5 sec")); _delayList.push_back (0.5); _maxDelayChoice->Append(wxT("1 sec")); _delayList.push_back (1.0); _maxDelayChoice->Append(wxT("2.5 sec")); _delayList.push_back (2.5); _maxDelayChoice->Append(wxT("5 sec")); _delayList.push_back (5.0); _maxDelayChoice->Append(wxT("10 sec")); _delayList.push_back (10.0); _maxDelayChoice->Append(wxT("20 sec")); _delayList.push_back (20.0); timeSizer->Add(_maxDelayChoice, 0, wxALL|wxALIGN_CENTER, 2); stattext = new wxStaticText(timepanel, -1, wxT("Tempo")); timeSizer->Add ( stattext, 0, wxALIGN_CENTER|wxLEFT, 4); _tempoSpinCtrl = new wxSpinCtrl(timepanel, FT_TempoSpinId, wxT("120"), wxDefaultPosition, wxSize(65,-1), wxSP_ARROW_KEYS, 1, 300, 120); timeSizer->Add(_tempoSpinCtrl, 0, wxALL|wxALIGN_CENTER, 2); timepanel->SetAutoLayout(TRUE); timeSizer->Fit( timepanel ); timepanel->SetSizer(timeSizer); ctrlbook->AddPage ( (wxNotebookPage *) timepanel, wxT("Time") , false); wxBoxSizer *booksizer = new wxBoxSizer (wxHORIZONTAL); booksizer->Add (ctrlbook, 1, wxALL, 0); wxStaticBitmap * logobit = new wxStaticBitmap(this, -1, wxBitmap(ftlogo_xpm)); //wxStaticBitmap * logobit = new wxStaticBitmap(this, -1, wxBitmap(ftlogo1_xpm)); //wxStaticBitmap * logobit = new wxStaticBitmap(this, -1, wxBitmap(ftlogo2_xpm)); booksizer->Add (logobit, 0, wxALIGN_BOTTOM); mainsizer->Add ( booksizer, 0, wxALL|wxEXPAND, 2 ); //_rowPanel = new wxPanel(this, -1); _rowPanel = new wxScrolledWindow(this, FT_RowPanel, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxHSCROLL|wxSUNKEN_BORDER); _rowPanel->SetBackgroundColour(wxColour(20,20,20)); _rowPanel->SetThemeEnabled(false); // ASSUME we have at least one spectral engine FTspectralEngine * sengine = _processPath[0]->getSpectralEngine(); vector procmods; sengine->getProcessorModules (procmods); wxBoxSizer *mainvsizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *tmpsizer, *tmpsizer2; _uppersizer = new wxBoxSizer(wxHORIZONTAL); _inspecsizer = new wxBoxSizer(wxHORIZONTAL); _inspecSash = new wxSashLayoutWindow(_rowPanel, FT_RowPanelId, wxDefaultPosition, wxSize(-1,_rowh)); _inspecSash->SetBackgroundColour(*wxBLACK); _inspecSash->SetThemeEnabled(false); _inspecPanel = new wxPanel(_inspecSash, -1); _inspecPanel->SetBackgroundColour(*wxBLACK); _inspecPanel->SetThemeEnabled(false); _inspecSash->SetSashBorder(wxSASH_BOTTOM, true); _inspecSash->SetSashVisible(wxSASH_BOTTOM, true); _rowItems.push_back( _inspecSash); // create master link and bypass buttons _inspecLabelButton = new wxButton(_inspecPanel, FT_InSpecLabelId, wxT("In Spectra"), wxDefaultPosition, wxSize(_labwidth,_bheight)); _inspecLabelButton->SetBackgroundColour(*wxBLACK); _inspecLabelButton->SetForegroundColour(*wxWHITE); _inspecLabelButton->SetThemeEnabled(false); _inspecLabelButton->SetFont(_titleFont); _inspecLabelButton->SetToolTip(wxT("Hide In Spectra")); wxLayoutConstraints * constr; // create alts _inspecLabelButtonAlt = new wxButton(_rowPanel, FT_InSpecLabelId, wxT("In Spectra"), wxDefaultPosition, wxSize(_labwidth,_bheight)); _inspecLabelButtonAlt->SetBackgroundColour(*wxBLACK); _inspecLabelButtonAlt->SetForegroundColour(*wxWHITE); _inspecLabelButtonAlt->SetThemeEnabled(false); _inspecLabelButtonAlt->SetFont(_titleAltFont); _inspecLabelButtonAlt->SetToolTip(wxT("Show In Spectra")); _inspecLabelButtonAlt->Show(false); constr = new wxLayoutConstraints; constr->left.SameAs (_rowPanel, wxLeft, 2); constr->width.Absolute (_labwidth); constr->top.SameAs (_rowPanel, wxTop); constr->height.Absolute (_bheight); _inspecLabelButtonAlt->SetConstraints(constr); _bypassAllCheck = new wxCheckBox(this, FT_BypassId, wxT("Bypass All"), wxDefaultPosition, wxSize(_labwidth,_bheight+3)); _bypassAllCheck->SetFont(_buttFont); _muteAllCheck = new wxCheckBox(this, FT_MuteId, wxT("Mute All"), wxDefaultPosition, wxSize(_labwidth,_bheight+3)); _muteAllCheck->SetFont(_buttFont); _linkMixCheck = new wxCheckBox(this, FT_MixLinkedButton, wxT("Link Mix"), wxDefaultPosition, wxSize(_labwidth,_bheight+3)); _linkMixCheck->SetFont(_buttFont); _pathCountChoice = new wxChoice(this, FT_PathCountChoice, wxDefaultPosition, wxSize(_labwidth,-1)); for (int i=0; i < FT_MAXPATHS; i++) { _pathCountChoice->Append(wxString::Format(wxT("%d chan"), i+1), (void *) ((intptr_t)(i+1))); } _pathCountChoice->SetStringSelection(wxString::Format(wxT("%d chan"), _startpaths)); // spec types buttons PixButton * pixbutt; pixbutt = _inspecSpecTypeAllButton = new PixButton(_inspecPanel, FT_InSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _inspecSpecTypeAllButton->SetFont(_buttFont); _inspecSpecTypeAllButton->SetToolTip (wxT("Spectrogram Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(specplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(specplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(specplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(specplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(specplot_active_xpm)); pixbutt = _inspecPlotSolidTypeAllButton = new PixButton(_inspecPanel, FT_InSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _inspecPlotSolidTypeAllButton->SetFont(_buttFont); _inspecPlotSolidTypeAllButton->SetToolTip (wxT("Filled Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(barplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(barplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(barplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(barplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(barplot_active_xpm)); pixbutt = _inspecPlotLineTypeAllButton = new PixButton(_inspecPanel, FT_InSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _inspecPlotLineTypeAllButton->SetFont(_buttFont); _inspecPlotLineTypeAllButton->SetToolTip (wxT("Line Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(lineplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(lineplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(lineplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(lineplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(lineplot_active_xpm)); // uppersizer tmpsizer = new wxBoxSizer(wxVERTICAL); tmpsizer->Add (_pathCountChoice, 0, wxALL, 1); tmpsizer->Add (1,4, 0); tmpsizer->Add (_bypassAllCheck, 0, wxALL, 1 ); _uppersizer->Add(tmpsizer, 0, wxEXPAND); mainvsizer->Add(_uppersizer, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 2); // input spectragram tmpsizer = new wxBoxSizer(wxVERTICAL); tmpsizer->Add (_inspecLabelButton, 0, wxALL , 1); tmpsizer2 = new wxBoxSizer(wxHORIZONTAL); tmpsizer2->Add (_inspecSpecTypeAllButton, 0, wxALL, 1); tmpsizer2->Add (_inspecPlotLineTypeAllButton, 0, wxALL, 1); tmpsizer2->Add (_inspecPlotSolidTypeAllButton, 0, wxALL, 1); tmpsizer->Add (tmpsizer2, 0, wxALL|wxEXPAND, 0); _inspecsizer->Add (tmpsizer, 0, wxALL|wxEXPAND, 0); _inspecPanel->SetAutoLayout(TRUE); _inspecsizer->Fit( _inspecPanel ); _inspecPanel->SetSizer(_inspecsizer); wxLayoutConstraints *inspecConst = new wxLayoutConstraints; inspecConst->top.SameAs (_rowPanel, wxTop, 2); inspecConst->left.SameAs (_rowPanel, wxLeft, 2); inspecConst->right.SameAs (_rowPanel, wxRight, 2); inspecConst->height.AsIs(); _inspecSash->SetConstraints(inspecConst); //_inspecSash->Show(false); // NOTE: need to create and push this onto rowItems // before calling pushProcRow _outspecsizer = new wxBoxSizer(wxHORIZONTAL); _lowersizer = new wxBoxSizer(wxHORIZONTAL); _outspecSash = new wxSashLayoutWindow(_rowPanel, FT_RowPanelId, wxDefaultPosition, wxSize(-1,_rowh)); _outspecPanel = new wxPanel(_outspecSash, -1); _outspecPanel->SetBackgroundColour(*wxBLACK); _outspecPanel->SetThemeEnabled(false); _outspecSash->SetSashBorder(wxSASH_BOTTOM, true); _outspecSash->SetSashVisible(wxSASH_BOTTOM, true); _rowItems.push_back (_outspecSash); wxWindow *lastsash = _inspecSash; int rowcnt=0; for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { // if the group is different from the last // make a new row for it if (filts[m]->getGroup() == lastgroup) { continue; } lastgroup = filts[m]->getGroup(); pushProcRow (filts[m]); lastsash = _rowSashes[rowcnt]; rowcnt++; } } //_mashsizer = new wxBoxSizer(wxHORIZONTAL); // _gatesizer = new wxBoxSizer(wxHORIZONTAL); // _freqsizer = new wxBoxSizer(wxHORIZONTAL); // _delaysizer = new wxBoxSizer(wxHORIZONTAL); // _feedbsizer = new wxBoxSizer(wxHORIZONTAL); //printf ("subrowpanel cnt = %d\n", _subrowPanels.size()); _outspecLabelButton = new wxButton(_outspecPanel, FT_OutSpecLabelId, wxT("Out Spectra"), wxDefaultPosition, wxSize(_labwidth,_bheight)); _outspecLabelButton->SetBackgroundColour(*wxBLACK); _outspecLabelButton->SetForegroundColour(*wxWHITE); _outspecLabelButton->SetThemeEnabled(false); _outspecLabelButton->SetFont(_titleFont); _outspecLabelButton->SetToolTip(wxT("Hide Out Spectra")); _outspecLabelButtonAlt = new wxButton(_rowPanel, FT_OutSpecLabelId, wxT("Out Spectra"), wxDefaultPosition, wxSize(_labwidth,_bheight)); _outspecLabelButtonAlt->SetFont(_titleAltFont); _outspecLabelButtonAlt->SetToolTip(wxT("Show Out Spectra")); _outspecLabelButtonAlt->SetBackgroundColour(*wxBLACK); _outspecLabelButtonAlt->SetForegroundColour(*wxWHITE); //_outspecLabelButtonAlt->SetThemeEnabled(false); _outspecLabelButtonAlt->Show(false); constr = new wxLayoutConstraints; constr->left.SameAs (_rowPanel, wxLeft, 2); constr->width.Absolute (_labwidth); constr->height.Absolute (_bheight); constr->top.SameAs (_outspecSash, wxTop); _outspecLabelButtonAlt->SetConstraints(constr); // @@@@@@@ pixbutt = _outspecSpecTypeAllButton = new PixButton(_outspecPanel, FT_OutSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _outspecSpecTypeAllButton->SetFont(_buttFont); _outspecSpecTypeAllButton->SetToolTip (wxT("Spectrogram Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(specplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(specplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(specplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(specplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(specplot_active_xpm)); pixbutt = _outspecPlotSolidTypeAllButton = new PixButton(_outspecPanel, FT_OutSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _outspecPlotSolidTypeAllButton->SetFont(_buttFont); _outspecPlotSolidTypeAllButton->SetToolTip (wxT("Filled Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(barplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(barplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(barplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(barplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(barplot_active_xpm)); pixbutt = _outspecPlotLineTypeAllButton = new PixButton(_outspecPanel, FT_OutSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _outspecPlotLineTypeAllButton->SetFont(_buttFont); _outspecPlotLineTypeAllButton->SetToolTip (wxT("Line Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(lineplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(lineplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(lineplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(lineplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(lineplot_active_xpm)); // output spectragram tmpsizer = new wxBoxSizer(wxVERTICAL); tmpsizer->Add (_outspecLabelButton, 0, wxALL , 1); tmpsizer2 = new wxBoxSizer(wxHORIZONTAL); tmpsizer2->Add (_outspecSpecTypeAllButton, 1, wxALL, 1); tmpsizer2->Add (_outspecPlotLineTypeAllButton, 1, wxALL, 1); tmpsizer2->Add (_outspecPlotSolidTypeAllButton, 1, wxALL, 1); tmpsizer->Add (tmpsizer2, 0, wxALL|wxEXPAND, 0); _outspecsizer->Add (tmpsizer, 0, wxALL|wxEXPAND, 0); _outspecPanel->SetAutoLayout(TRUE); _outspecsizer->Fit( _outspecPanel ); _outspecPanel->SetSizer(_outspecsizer); wxLayoutConstraints *outspecConst = new wxLayoutConstraints; outspecConst->left.SameAs (_rowPanel, wxLeft, 2); outspecConst->right.SameAs (_rowPanel, wxRight, 2); outspecConst->top.SameAs (lastsash, wxBottom, 2); outspecConst->height.AsIs(); _outspecSash->SetConstraints(outspecConst); //_outspecSash->Show(false); _rowPanel->SetAutoLayout(TRUE); mainvsizer->Add (_rowPanel, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 2); // lowersizer tmpsizer = new wxBoxSizer(wxVERTICAL); tmpsizer->Add (1,10,0); tmpsizer->Add (_muteAllCheck, 0, wxALL, 1); tmpsizer->Add (_linkMixCheck, 0, wxALL, 1); _lowersizer->Add(tmpsizer, 0, wxEXPAND); mainvsizer->Add(_lowersizer, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, 2); for (int i=0; i < _startpaths; i++) { // add to io support instance //_processPath[i] = iosup->setProcessPathActive (i, true); if (!_processPath[i]) continue; FTspectralEngine * engine = _processPath[i]->getSpectralEngine(); // set default freqbin _freqBinsChoice->SetStringSelection(wxString::Format(wxT("%d"), engine->getFFTsize()/2)); engine->setUpdateToken (_updateTokens[i]); createPathStuff (i); engine->setTempo (_tempoSpinCtrl->GetValue()); // purely for saving if (i > 0) { // link everything to first vector newprocmods; engine->getProcessorModules (newprocmods); for (unsigned int n=0; n < newprocmods.size(); ++n) { FTprocI *pm = newprocmods[n]; vector filts; pm->getFilters (filts); for (unsigned int m=0; m < filts.size(); ++m) { filts[m]->link (procmods[n]->getFilter(m)); } } } } rebuildPresetCombo(); mainsizer->Add(mainvsizer, 1, wxALL|wxEXPAND, 0); SetAutoLayout( TRUE ); // set frame to minimum size mainsizer->Fit( this ); // don't allow frame to get smaller than what the sizers tell ye mainsizer->SetSizeHints( this ); SetSizer( mainsizer ); rowpanelScrollSize(); //wxToolTip::Enable(true); // force a nice minimum size this->SetSizeHints(453,281); // set timer _eventTimer->Start(_updateMS, FALSE); _refreshTimer->Start(_refreshMS, FALSE); } void FTmainwin::pushProcRow(FTspectrumModifier *specmod) { wxSashLayoutWindow * lastsash; if (_rowSashes.size() == 0) { lastsash = _inspecSash; } else { lastsash = _rowSashes.back(); } wxBoxSizer *rowsizer = new wxBoxSizer(wxHORIZONTAL); _rowSizers.push_back (rowsizer); wxSashLayoutWindow * sash = new wxSashLayoutWindow(_rowPanel, FT_RowPanelId, wxDefaultPosition, wxSize(-1,_rowh)); sash->SetBackgroundColour(wxColour(20,20,20)); sash->SetThemeEnabled(false); _rowSashes.push_back (sash); wxPanel * rpanel = new wxPanel(sash, -1); rpanel->SetBackgroundColour(*wxBLACK); rpanel->SetThemeEnabled(false); _rowPanels.push_back (rpanel); sash->SetSashBorder(wxSASH_BOTTOM, true); sash->SetSashVisible(wxSASH_BOTTOM, true); // need to insert this as second to last wxWindow * lastrow = _rowItems.back(); _rowItems.pop_back(); _rowItems.push_back (sash); _rowItems.push_back (lastrow); string name = specmod->getName(); // main label button wxButton *labbutt = new FTtitleButton(this, false, rpanel, FT_LabelBase, wxString::FromAscii (name.c_str()), wxDefaultPosition, wxSize(_labwidth,_bheight)); labbutt->SetFont(_titleFont); labbutt->SetToolTip(wxString(wxT("Hide ")) + wxString::FromAscii (name.c_str()) + wxT("\nRight-click for menu")); _labelButtons.push_back (labbutt); // alt label button wxButton * altlab = new FTtitleButton(this, true, _rowPanel, FT_LabelBase, wxString::FromAscii (name.c_str()), wxDefaultPosition, wxSize(_labwidth,_bheight)); altlab->SetFont(_titleAltFont); altlab->SetToolTip(wxString(wxT("Show ")) + wxString::FromAscii (name.c_str()) + wxT("\nRight-click for menu")); altlab->Show(false); wxLayoutConstraints * constr = new wxLayoutConstraints; constr->left.SameAs (_rowPanel, wxLeft, 2); constr->width.Absolute (_labwidth); constr->height.Absolute (_bheight); constr->top.SameAs (sash, wxTop); altlab->SetConstraints(constr); _altLabelButtons.push_back (altlab); // link all button PixButton * pixbutt; PixButton * linkallbutt = pixbutt = new PixButton(rpanel, FT_LinkBase, false, wxDefaultPosition, wxSize(_bwidth,_bheight)); linkallbutt->SetFont(_buttFont); linkallbutt->SetToolTip (wxT("Link All")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::link_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(link_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(link_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(link_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(link_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(link_active_xpm)); _linkAllButtons.push_back (linkallbutt); // bypass all button PixButton * bypallbutt = pixbutt = new PixButton(rpanel, FT_BypassBase, false, wxDefaultPosition, wxSize(_bwidth,_bheight)); bypallbutt->SetFont(_buttFont); bypallbutt->SetToolTip (wxT("Bypass All")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::bypass_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(bypass_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(bypass_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(bypass_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(bypass_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(bypass_active_xpm)); _bypassAllButtons.push_back (bypallbutt); // Grid buttons PixButton * gridbutt = pixbutt = new PixButton (rpanel, FT_GridBase, false, wxDefaultPosition, wxSize(_bwidth,_bheight)); gridbutt->SetFont(_buttFont); gridbutt->SetToolTip (wxT("Toggle Grid\nRight-click to Adjust")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::grid_clicked_events), pixbutt)); pixbutt->pressed.connect (bind (slot (*this, &FTmainwin::grid_pressed_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(grid_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(grid_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(grid_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(grid_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(grid_active_xpm)); _gridButtons.push_back (gridbutt); // GridSnap buttons PixButton * gridsnbutt = pixbutt = new PixButton (rpanel, FT_GridSnapBase, false, wxDefaultPosition, wxSize(_bwidth,_bheight)); gridsnbutt->SetFont(_buttFont); gridsnbutt->SetToolTip (wxT("Toggle Grid Snap")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::grid_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(gridsnap_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(gridsnap_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(gridsnap_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(gridsnap_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(gridsnap_active_xpm)); _gridSnapButtons.push_back (gridsnbutt); // main row stuff wxBoxSizer * rowbuttsizer = new wxBoxSizer(wxVERTICAL); rowbuttsizer->Add (labbutt, 0, wxALL , 1); wxBoxSizer * tmpsizer2 = new wxBoxSizer(wxHORIZONTAL); tmpsizer2->Add (bypallbutt, 0, wxALL, 1); tmpsizer2->Add (linkallbutt, 0, wxALL, 1); rowbuttsizer->Add (tmpsizer2, 0, wxALL|wxEXPAND, 0); tmpsizer2 = new wxBoxSizer(wxHORIZONTAL); tmpsizer2->Add (gridbutt, 0, wxALL, 1); tmpsizer2->Add (gridsnbutt, 0, wxALL, 1); rowbuttsizer->Add (tmpsizer2, 0, wxALL|wxEXPAND, 0); _rowButtSizers.push_back ( rowbuttsizer); rowsizer->Add (rowbuttsizer, 0, wxALL|wxEXPAND, 0); rpanel->SetAutoLayout(TRUE); rowsizer->Fit( rpanel ); rpanel->SetSizer(rowsizer); wxLayoutConstraints *rowconst = new wxLayoutConstraints; rowconst->left.SameAs (_rowPanel, wxLeft, 2); rowconst->right.SameAs (_rowPanel, wxRight, 2); rowconst->top.SameAs (lastsash, wxBottom, 2); rowconst->height.AsIs(); sash->SetConstraints(rowconst); // construct initial arrays FTactiveBarGraph ** bgraphs = new FTactiveBarGraph*[FT_MAXPATHS]; for (int n=0; n < FT_MAXPATHS; ++n) bgraphs[n] = 0; _barGraphs.push_back (bgraphs); wxPanel ** srpanels = new wxPanel*[FT_MAXPATHS]; for (int n=0; n < FT_MAXPATHS; ++n) srpanels[n] = 0; _subrowPanels.push_back (srpanels); PixButton ** bybuttons = new PixButton*[FT_MAXPATHS]; for (int n=0; n < FT_MAXPATHS; ++n) bybuttons[n] = 0; _bypassButtons.push_back (bybuttons); PixButton ** linkbuttons = new PixButton*[FT_MAXPATHS]; for (int n=0; n < FT_MAXPATHS; ++n) linkbuttons[n] = 0; _linkButtons.push_back (linkbuttons); } void FTmainwin::popProcRow() { // remove the last row of stuff wxWindow * top = _rowSashes.back(); //wxSizer * topsizer = _rowSizers.back(); //wxPanel * rpanel = _rowPanels.back(); // pop all the stuff we pushed before _rowSizers.pop_back(); _rowSashes.pop_back(); _rowPanels.pop_back(); // need to pop the second to last off _rowItems.pop_back(); _rowItems.pop_back(); _rowItems.push_back(_outspecSash); _labelButtons.pop_back(); _bypassAllButtons.pop_back(); _linkAllButtons.pop_back(); _rowButtSizers.pop_back(); _gridButtons.pop_back(); _gridSnapButtons.pop_back(); // owned by _rowPanel wxButton * altbutt = _altLabelButtons.back(); altbutt->SetConstraints(NULL); altbutt->Destroy(); _altLabelButtons.pop_back(); FTactiveBarGraph **bgraphs = _barGraphs.back(); delete [] bgraphs; _barGraphs.pop_back(); wxPanel **srpanels = _subrowPanels.back(); delete [] srpanels; _subrowPanels.pop_back(); PixButton **bybuttons = _bypassButtons.back(); delete [] bybuttons; _bypassButtons.pop_back(); PixButton **linkbuttons = _linkButtons.back(); delete [] linkbuttons; _linkButtons.pop_back(); wxLayoutConstraints * outspecConst = _outspecSash->GetConstraints(); if (_rowSashes.size() > 0) { outspecConst->top.SameAs (_rowSashes.back(), wxBottom, 2); _outspecLabelButtonAlt->GetConstraints()->top.Below(_rowSashes.back(), 2); } else { outspecConst->top.SameAs (_inspecSash, wxBottom, 2); _outspecLabelButtonAlt->GetConstraints()->top.Below(_inspecSash, 2); } // this should destroy all the wx windows and stuff top->SetConstraints(NULL); top->Destroy(); _rowPanel->Layout(); rowpanelScrollSize(); } // void FTmainwin::OnSize(wxSizeEvent &event) // { // // rowpanelScrollSize(); // event.Skip(); // } void FTmainwin::removePathStuff(int i, bool deactivate) { FTspectralEngine * engine = _processPath[i]->getSpectralEngine(); if (deactivate) { // deactivate it by the io thread FTioSupport::instance()->setProcessPathActive(i, false); _processPath[i] = 0; } vector procmods; engine->getProcessorModules (procmods); _uppersizer->Remove(i+1); _inspecsizer->Remove(i+1); for (unsigned int n=0; n < _rowSizers.size(); ++n) { _rowSizers[n]->Remove (i+1); _subrowPanels[n][i]->Destroy(); _rowSizers[n]->Layout(); } // unsigned int rowcnt = 0; // for (unsigned int n=0; n < procmods.size(); ++n) // { // FTprocI *pm = procmods[n]; // vector filts; // pm->getFilters (filts); // int lastgroup=-1; // for (unsigned int m=0; m < filts.size(); ++m) // { // if (filts[m]->getGroup() == lastgroup) { // continue; // } // lastgroup = filts[m]->getGroup(); // _rowSizers[rowcnt]->Remove (i+1); // _subrowPanels[rowcnt][i]->Destroy(); // _rowSizers[rowcnt]->Layout(); // rowcnt++; // } // } _outspecsizer->Remove(i+1); _lowersizer->Remove(i+1); _upperPanels[i]->Destroy(); _inspecPanels[i]->Destroy(); _outspecPanels[i]->Destroy(); _lowerPanels[i]->Destroy(); _uppersizer->Layout(); _inspecsizer->Layout(); _outspecsizer->Layout(); _lowersizer->Layout(); } void FTmainwin::createPathStuff(int i) { wxBoxSizer * buttsizer, *tmpsizer, *tmpsizer2; wxStaticText *stattext; FTspectralEngine * engine = _processPath[i]->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); _upperPanels[i] = new wxPanel(this, -1); _lowerPanels[i] = new wxPanel(this, -1); _inspecPanels[i] = new wxPanel(_inspecPanel, -1); _inspecPanels[i]->SetBackgroundColour(*wxBLACK); _inspecPanels[i]->SetThemeEnabled(false); int rowcnt=-1; // preincremented below for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { wxPanel ** rowpanels = 0; FTactiveBarGraph **bargraphs = 0; if (filts[m]->getGroup() != lastgroup) { rowcnt++; rowpanels = _subrowPanels[rowcnt]; bargraphs = _barGraphs[rowcnt]; rowpanels[i] = new wxPanel (_rowPanels[rowcnt], -1); rowpanels[i]->SetBackgroundColour(*wxBLACK); rowpanels[i]->SetThemeEnabled(false); bargraphs[i] = new FTactiveBarGraph(this, rowpanels[i], -1); bargraphs[i]->setSpectrumModifier (filts[m]); bargraphs[i]->setBypassed (filts[m]->getBypassed()); bargraphs[i]->setTempo(_tempoSpinCtrl->GetValue()); lastgroup = filts[m]->getGroup(); } else { // assign nth filter to already created plot // TODO: support more than 2 rowpanels = _subrowPanels[rowcnt]; bargraphs = _barGraphs[rowcnt]; bargraphs[i]->setTopSpectrumModifier (filts[m]); continue; } buttsizer = new wxBoxSizer(wxVERTICAL); PixButton * pixbutt; pixbutt = new PixButton(rowpanels[i], FT_BypassBase, false, wxDefaultPosition, wxSize(_bwidth, -1)); pixbutt->set_normal_bitmap (wxBitmap(bypass_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(bypass_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(bypass_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(bypass_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(bypass_active_xpm)); _bypassButtons[rowcnt][i] = pixbutt; //buttsizer->Add ( _bypassButtons[rowcnt][i] = new wxButton(rowpanels[i], FT_BypassBase, wxT("B"), // wxDefaultPosition, wxSize(_bwidth,-1)), 1, 0,0); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::bypass_clicked_events), pixbutt)); buttsizer->Add (pixbutt, 0, 0, 0); //buttsizer->Add ( _bypassButtons[rowcnt][i] = new wxButton(rowpanels[i], FT_BypassBase, wxT("B"), // wxDefaultPosition, wxSize(_bwidth,-1)), 1, 0,0); _bypassButtons[rowcnt][i]->SetFont(_buttFont); _bypassButtons[rowcnt][i]->SetToolTip(wxT("Toggle Bypass")); pixbutt = new PixButton(rowpanels[i], FT_LinkBase, false, wxDefaultPosition, wxSize(_bwidth, -1)); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::link_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(link_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(link_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(link_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(link_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(link_active_xpm)); _linkButtons[rowcnt][i] = pixbutt; //buttsizer->Add ( _linkButtons[rowcnt][i] = new wxButton(rowpanels[i], FT_LinkBase, wxT("L"), // wxDefaultPosition, wxSize(_bwidth,-1)), 0, wxTOP,3); buttsizer->Add (_linkButtons[rowcnt][i], 0, wxTOP, 3); _linkButtons[rowcnt][i]->SetFont(_buttFont); _linkButtons[rowcnt][i]->SetToolTip(wxT("Link")); tmpsizer = new wxBoxSizer(wxHORIZONTAL); tmpsizer->Add ( buttsizer, 0, wxALL|wxEXPAND, 1); tmpsizer->Add ( bargraphs[i], 1, wxALL|wxEXPAND, 1); rowpanels[i]->SetAutoLayout(TRUE); tmpsizer->Fit( rowpanels[i] ); rowpanels[i]->SetSizer(tmpsizer); _rowSizers[rowcnt]->Insert (i+1, rowpanels[i], 1, wxLEFT|wxEXPAND, 4); } } _outspecPanels[i] = new wxPanel(_outspecPanel, -1); _outspecPanels[i]->SetBackgroundColour(*wxBLACK); _outspecPanels[i]->SetThemeEnabled(false); wxStaticBox *inbox = new wxStaticBox(_upperPanels[i], -1, wxString::Format(wxT("Input %d"), i+1)); wxStaticBox *outbox = new wxStaticBox(_lowerPanels[i], -1, wxString::Format(wxT("Output %d"), i+1)); // plots and active graphs _inputSpectragram[i] = new FTspectragram(this, _inspecPanels[i], -1); _inputSpectragram[i]->setDataLength((unsigned int)engine->getFFTsize() >> 1); _outputSpectragram[i] = new FTspectragram(this, _outspecPanels[i], -1); _outputSpectragram[i]->setDataLength((unsigned int)engine->getFFTsize() >> 1); // I/O buttons _inputButton[i] = new wxButton(_upperPanels[i], (int) FT_InputButtonId, wxT("No Input"), wxDefaultPosition, wxSize(-1,-1)); _outputButton[i] = new wxButton(_lowerPanels[i], (int) FT_OutputButtonId, wxT("No Output"), wxDefaultPosition, wxSize(-1,-1)); _bypassCheck[i] = new wxCheckBox(_upperPanels[i], (int) FT_BypassId, wxT("Bypass"), wxDefaultPosition, wxSize(-1,-1)); _muteCheck[i] = new wxCheckBox(_lowerPanels[i], (int) FT_MuteId, wxT("Mute"), wxDefaultPosition, wxSize(-1,-1)); // input area { tmpsizer = new wxStaticBoxSizer (inbox, wxVERTICAL); tmpsizer->Add (_inputButton[i], 0, wxBOTTOM|wxEXPAND, 1); tmpsizer2 = new wxBoxSizer (wxHORIZONTAL); tmpsizer2->Add (_bypassCheck[i], 1, wxRIGHT|wxALIGN_CENTRE_VERTICAL, 3); stattext = new wxStaticText(_upperPanels[i], -1, wxT("Gain (dB)"), wxDefaultPosition, wxDefaultSize); tmpsizer2->Add (stattext, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 0); //_gainSlider[i] = new wxSlider(this, FT_GainSlider, 0, -70, 10); //tmpsizer2->Add (_gainSlider[i], 1, wxALL|wxALIGN_CENTRE_VERTICAL, 1); _gainSpinCtrl[i] = new wxSpinCtrl(_upperPanels[i], FT_GainSpin, wxT("0"), wxDefaultPosition, wxSize(65,-1), wxSP_ARROW_KEYS, -70, 10, 0); tmpsizer2->Add (_gainSpinCtrl[i], 0, wxLEFT, 4); tmpsizer->Add (tmpsizer2, 0, wxTOP|wxEXPAND, 1); _upperPanels[i]->SetAutoLayout(TRUE); tmpsizer->Fit( _upperPanels[i] ); _upperPanels[i]->SetSizer(tmpsizer); _uppersizer->Insert (i+1, _upperPanels[i], 1, wxLEFT, 3); } // input spec { buttsizer = new wxBoxSizer(wxVERTICAL); PixButton * pixbutt; pixbutt = _inspecSpecTypeButton[i] = new PixButton(_inspecPanels[i], FT_InSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _inspecSpecTypeButton[i]->SetFont(_buttFont); _inspecSpecTypeButton[i]->SetToolTip(wxT("Spectrogram Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(specplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(specplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(specplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(specplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(specplot_active_xpm)); buttsizer->Add ( _inspecSpecTypeButton[i], 0, wxALL , 1); pixbutt = _inspecPlotLineTypeButton[i] = new PixButton(_inspecPanels[i], FT_InSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _inspecPlotLineTypeButton[i]->SetFont(_buttFont); _inspecPlotLineTypeButton[i]->SetToolTip(wxT("Line Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(lineplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(lineplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(lineplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(lineplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(lineplot_active_xpm)); buttsizer->Add ( _inspecPlotLineTypeButton[i], 0, wxALL , 1); pixbutt = _inspecPlotSolidTypeButton[i] = new PixButton(_inspecPanels[i], FT_InSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _inspecPlotSolidTypeButton[i]->SetFont(_buttFont); _inspecPlotSolidTypeButton[i]->SetToolTip(wxT("Filled Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(barplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(barplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(barplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(barplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(barplot_active_xpm)); buttsizer->Add ( _inspecPlotSolidTypeButton[i], 0, wxALL ,1); tmpsizer = new wxBoxSizer(wxHORIZONTAL); tmpsizer->Add ( buttsizer, 0, wxALL|wxEXPAND, 0); tmpsizer->Add ( _inputSpectragram[i], 1, wxALL|wxEXPAND, 1); _inspecPanels[i]->SetAutoLayout(TRUE); tmpsizer->Fit( _inspecPanels[i] ); _inspecPanels[i]->SetSizer(tmpsizer); _inspecsizer->Insert (i+1, _inspecPanels[i], 1, wxLEFT|wxEXPAND, 4); } // output spec { buttsizer = new wxBoxSizer(wxVERTICAL); PixButton * pixbutt; pixbutt = _outspecSpecTypeButton[i] = new PixButton(_outspecPanels[i], FT_OutSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _outspecSpecTypeButton[i]->SetFont(_buttFont); _outspecSpecTypeButton[i]->SetToolTip(wxT("Spectrogram Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(specplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(specplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(specplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(specplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(specplot_active_xpm)); buttsizer->Add ( _outspecSpecTypeButton[i], 0, wxALL,1); pixbutt = _outspecPlotLineTypeButton[i] = new PixButton(_outspecPanels[i], FT_OutSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _outspecPlotLineTypeButton[i]->SetFont(_buttFont); _outspecPlotLineTypeButton[i]->SetToolTip(wxT("Line Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(lineplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(lineplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(lineplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(lineplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(lineplot_active_xpm)); buttsizer->Add ( _outspecPlotLineTypeButton[i], 0, wxALL, 1); pixbutt = _outspecPlotSolidTypeButton[i] = new PixButton(_outspecPanels[i], FT_OutSpecTypeId, false, wxDefaultPosition, wxSize(_bwidth, _bheight)); _outspecPlotSolidTypeButton[i]->SetFont(_buttFont); _outspecPlotSolidTypeButton[i]->SetToolTip(wxT("Filled Plot")); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::plot_clicked_events), pixbutt)); pixbutt->set_normal_bitmap (wxBitmap(barplot_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(barplot_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(barplot_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(barplot_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(barplot_active_xpm)); buttsizer->Add ( _outspecPlotSolidTypeButton[i], 0, wxALL, 1); tmpsizer = new wxBoxSizer(wxHORIZONTAL); tmpsizer->Add ( buttsizer, 0, wxALL|wxEXPAND, 0); tmpsizer->Add ( _outputSpectragram[i], 1, wxALL|wxEXPAND, 1); _outspecPanels[i]->SetAutoLayout(TRUE); tmpsizer->Fit( _outspecPanels[i] ); _outspecPanels[i]->SetSizer(tmpsizer); _outspecsizer->Insert (i+1, _outspecPanels[i], 1, wxLEFT|wxEXPAND, 4); } // output stuff { tmpsizer = new wxStaticBoxSizer (outbox, wxVERTICAL); tmpsizer2 = new wxBoxSizer (wxHORIZONTAL); tmpsizer2->Add (_muteCheck[i], 1, wxRIGHT, 5); stattext = new wxStaticText(_lowerPanels[i], -1, wxT("Dry"), wxDefaultPosition, wxDefaultSize); tmpsizer2->Add (stattext, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 1); _mixSlider[i] = new wxSlider(_lowerPanels[i], FT_MixSlider, 1000, 0, 1000); tmpsizer2->Add (_mixSlider[i], 2, wxALL|wxALIGN_CENTRE_VERTICAL, 1); stattext = new wxStaticText(_lowerPanels[i], -1, wxT("Wet"), wxDefaultPosition, wxDefaultSize); tmpsizer2->Add (stattext, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 1); tmpsizer->Add (tmpsizer2, 0, wxBOTTOM|wxEXPAND, 1); tmpsizer->Add(_outputButton[i], 0, wxEXPAND|wxTOP, 1); _lowerPanels[i]->SetAutoLayout(TRUE); tmpsizer->Fit( _lowerPanels[i] ); _lowerPanels[i]->SetSizer(tmpsizer); _lowersizer->Insert (i+1, _lowerPanels[i], 1, wxLEFT, 3); } engine->setUpdateToken (_updateTokens[i]); } void FTmainwin::rowpanelScrollSize() { //int mw, mh; //int w, h; //int vw, vh; //GetClientSize(&mw, &mh); //_rowPanel->GetClientSize(&w, &h); //_rowPanel->GetVirtualSize(&vw, &vh); // calculate virtual full height of rowpanel int realh = 0; for (unsigned int i=0; i < _rowItems.size(); i++) { // printf ("rowpanelsize: %d %d\n", i, _rowItems.size()); realh += _rowItems[i]->GetSize().GetHeight() + 2; } //printf ("rowpanel size %d %d %d %d realh %d\n", w, h, vw, vh, realh); _rowPanel->SetScrollbars(1, 1, 0, realh); } void FTmainwin::updateDisplay() { FTioSupport *iosup = FTioSupport::instance(); const char ** portnames = 0; bool inspec=true, inplotline=true, inplotsolid=true; bool outspec=true, outplotline=true, outplotsolid=true; bool bypassed=true, muted=true, linked, active; vector bypvec(_rowSizers.size(), true); vector linkvec(_rowSizers.size(), true); vector gridvec(_rowSizers.size(), true); vector gridsnapvec(_rowSizers.size(), true); for (int i=0; i<_pathCount; i++) { if (!_processPath[i]) continue; // update port button labels portnames = iosup->getConnectedInputPorts(i); if (portnames) { _inputButton[i]->SetLabel (wxString::FromAscii (portnames[0])); free(portnames); } else { _inputButton[i]->SetLabel (wxT("No Input")); } portnames = iosup->getConnectedOutputPorts(i); if (portnames) { _outputButton[i]->SetLabel (wxString::FromAscii (portnames[0])); free(portnames); } else { _outputButton[i]->SetLabel (wxT("No Output")); } // update bypass and link buttons FTspectralEngine *engine = _processPath[i]->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); unsigned int rowcnt=0; for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { if (filts[m]->getGroup() == lastgroup) { // the first of any group will do continue; } lastgroup = filts[m]->getGroup(); //_bypassButtons[rowcnt][i]->SetBackgroundColour ((filts[m]->getBypassed() ? (_activeBg) : (_defaultBg))); _bypassButtons[rowcnt][i]->set_active (filts[m]->getBypassed()); if (bypvec[rowcnt] && !filts[m]->getBypassed()) bypvec[rowcnt] = false; linked = ( filts[m]->getLink()!=0 || filts[m]->getLinkedFrom().size() > 0); //_linkButtons[rowcnt][i]->SetBackgroundColour ((linked ? (_activeBg) : (_defaultBg))); _linkButtons[rowcnt][i]->set_active (linked); if (linkvec[rowcnt] && i!=0 && !linked) linkvec[rowcnt] = false; if (gridvec[rowcnt] && !_barGraphs[rowcnt][i]->getGridLines()) gridvec[rowcnt] = false; if (gridsnapvec[rowcnt] && !_barGraphs[rowcnt][i]->getGridSnap()) gridsnapvec[rowcnt] = false; if (_barGraphs[rowcnt][i]->getTempo() != engine->getTempo()) { _barGraphs[rowcnt][i]->setTempo(engine->getTempo()); } rowcnt++; } } _bypassCheck[i]->SetValue(engine->getBypassed()); if (!engine->getBypassed()) bypassed = false; _muteCheck[i]->SetValue(engine->getMuted()); if (!engine->getMuted()) muted = false; // sliders and stuff _gainSpinCtrl[i]->SetValue ((int) (20 * FTutils::fast_log10 ( engine->getInputGain() ))); _mixSlider[i]->SetValue ((int) ( engine->getMixRatio() * 1000 )); // plots active = _inputSpectragram[i]->getPlotType()==FTspectragram::SPECTRAGRAM; _inspecSpecTypeButton[i]->set_active (active); if (inspec && !active) inspec = false; active = _inputSpectragram[i]->getPlotType()==FTspectragram::AMPFREQ_SOLID; _inspecPlotSolidTypeButton[i]->set_active (active); if (inplotsolid && !active) inplotsolid = false; active = _inputSpectragram[i]->getPlotType()==FTspectragram::AMPFREQ_LINES; _inspecPlotLineTypeButton[i]->set_active (active); if (inplotline && !active) inplotline = false; active = _outputSpectragram[i]->getPlotType()==FTspectragram::SPECTRAGRAM; _outspecSpecTypeButton[i]->set_active(active); if (outspec && !active) outspec = false; active = _outputSpectragram[i]->getPlotType()==FTspectragram::AMPFREQ_SOLID; _outspecPlotSolidTypeButton[i]->set_active(active); if (outplotsolid && !active) outplotsolid = false; active = _outputSpectragram[i]->getPlotType()==FTspectragram::AMPFREQ_LINES; _outspecPlotLineTypeButton[i]->set_active(active); if (outplotline && !active) outplotline = false; } for (unsigned int n=0; n < _bypassAllButtons.size(); ++n) { _bypassAllButtons[n]->set_active (bypvec[n]); _linkAllButtons[n]->set_active (linkvec[n]); _gridButtons[n]->set_active (gridvec[n]); _gridSnapButtons[n]->set_active (gridsnapvec[n]); } _bypassAllCheck->SetValue (bypassed); _muteAllCheck->SetValue (muted); _linkMixCheck->SetValue (_linkedMix); _inspecSpecTypeAllButton->set_active (inspec); _inspecPlotLineTypeAllButton->set_active (inplotline); _inspecPlotSolidTypeAllButton->set_active (inplotsolid); _outspecSpecTypeAllButton->set_active (outspec); _outspecPlotLineTypeAllButton->set_active (outplotline); _outspecPlotSolidTypeAllButton->set_active (outplotsolid); _pathCountChoice->SetSelection(_pathCount - 1); if (_processPath[0]) { FTspectralEngine * engine = _processPath[0]->getSpectralEngine(); if (engine->getUpdateSpeed() == FTspectralEngine::SPEED_TURTLE) _plotSpeedChoice->SetSelection(0); else if (engine->getUpdateSpeed() == FTspectralEngine::SPEED_SLOW) _plotSpeedChoice->SetSelection(1); else if (engine->getUpdateSpeed() == FTspectralEngine::SPEED_MED) _plotSpeedChoice->SetSelection(2); else if (engine->getUpdateSpeed() == FTspectralEngine::SPEED_FAST) _plotSpeedChoice->SetSelection(3); _windowingChoice->SetSelection(engine->getWindowing()); const int * fftbins = FTspectralEngine::getFFTSizes(); for (int i=0; i < FTspectralEngine::getFFTSizeCount(); i++) { if (fftbins[i] == engine->getFFTsize()) { _freqBinsChoice->SetSelection(i); break; } } // hack for (int i=0; i < 5; i++) { if (engine->getOversamp() == 1<SetSelection(i); break; } } for (unsigned int i=0; i < _delayList.size(); ++i) { if (engine->getMaxDelay() == _delayList[i]) { _maxDelayChoice->SetSelection(i); break; } } _tempoSpinCtrl->SetValue(engine->getTempo()); } _ioNameText->SetValue (wxString::FromAscii (iosup->getName())); // reset timer just in case _updateMS = 10; // start small _eventTimer->Stop(); _eventTimer->Start(_updateMS, FALSE); } // event handlers void FTmainwin::handleInputButton(wxCommandEvent &event) { wxObject *source = event.GetEventObject(); wxString label(wxT("No Input")); for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; if (source == _inputButton[i]) { FTportSelectionDialog *dial = new FTportSelectionDialog(this, wxNewId(), i, FTportSelectionDialog::INPUT, wxT("Input Port Selection")); dial->update(); dial->SetSize(wxSize(190,190)); dial->CentreOnParent(); if (dial->ShowModal() == wxID_OK) { const char ** pnames = dial->getSelectedPorts(); FTioSupport::instance()->disconnectPathInput(i, NULL); // disconnect all if (pnames) { for (int j=0; pnames[j]; j++) { FTioSupport::instance()->connectPathInput(i, pnames[j]); } free(pnames); } } dial->Close(); } } updateDisplay(); } void FTmainwin::handleOutputButton(wxCommandEvent &event) { wxObject *source = event.GetEventObject(); wxString label(wxT("No Output")); for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; if (source == _outputButton[i]) { FTportSelectionDialog *dial = new FTportSelectionDialog(this, wxNewId(), i, FTportSelectionDialog::OUTPUT, wxT("Output Port Selection")); dial->update(); dial->SetSize(wxSize(190,190)); dial->CentreOnParent(); if (dial->ShowModal() == wxID_OK) { const char ** pnames = dial->getSelectedPorts(); FTioSupport::instance()->disconnectPathOutput(i, NULL); // disconnect all if (pnames) { for (int j=0; pnames[j]; j++) { FTioSupport::instance()->connectPathOutput(i, pnames[j]); } free(pnames); } } dial->Close(); } } updateDisplay(); } void FTmainwin::bypass_clicked_events (int button, PixButton * source) { bool alldone = false; for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; bool done = false; FTspectralEngine *engine = _processPath[i]->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); int rowcnt=-1; // preincremented below for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { if (filts[m]->getGroup() != lastgroup) { rowcnt++; lastgroup = filts[m]->getGroup(); } if (source == _bypassButtons[rowcnt][i]) { filts[m]->setBypassed ( ! filts[m]->getBypassed() ); _barGraphs[rowcnt][i]->setBypassed (filts[m]->getBypassed()); _bypassButtons[rowcnt][i]->set_active(filts[m]->getBypassed()); alldone = done = true; } else if (source == _bypassAllButtons[rowcnt]) { filts[m]->setBypassed ( !_bypassAllButtons[rowcnt]->get_active()); _barGraphs[rowcnt][i]->setBypassed (filts[m]->getBypassed()); done = true; } } if (done) break; } if (alldone) break; } updateDisplay(); } void FTmainwin::handleBypassButtons (wxCommandEvent &event) { wxObject *source = event.GetEventObject(); bool alldone = false; for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; bool done = false; FTspectralEngine *engine = _processPath[i]->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); int rowcnt=-1; // preincremented below for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { if (filts[m]->getGroup() != lastgroup) { rowcnt++; lastgroup = filts[m]->getGroup(); } // if (source == _bypassButtons[rowcnt][i]) // { // filts[m]->setBypassed ( ! filts[m]->getBypassed() ); // _barGraphs[rowcnt][i]->setBypassed (filts[m]->getBypassed()); // alldone = done = true; // } // if (source == _bypassAllButtons[rowcnt]) { // filts[m]->setBypassed ( _bypassAllButtons[rowcnt]->GetBackgroundColour() != _activeBg); // _barGraphs[rowcnt][i]->setBypassed (filts[m]->getBypassed()); // done = true; // } if (source == _bypassAllCheck) { engine->setBypassed( _bypassAllCheck->GetValue()); if (engine->getBypassed()) { _updateTokens[i]->setIgnore(true); } else { _updateTokens[i]->setIgnore(false); } done = true; break; } else if (source == _bypassCheck[i]) { engine->setBypassed( _bypassCheck[i]->GetValue()); if (engine->getBypassed()) { _updateTokens[i]->setIgnore(true); } else { _updateTokens[i]->setIgnore(false); } alldone = done = true; break; } else if (source == _muteAllCheck) { engine->setMuted( _muteAllCheck->GetValue()); done = true; break; } else if (source == _muteCheck[i]) { engine->setMuted( _muteCheck[i]->GetValue()); done = alldone = true; break; } } if (done) break; } if (alldone) break; } updateDisplay(); } void FTmainwin::handlePlotTypeButtons (wxCommandEvent &event) { wxObject *source = event.GetEventObject(); for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; if (source == _inspecSpecTypeButton[i]) { _inputSpectragram[i]->setPlotType (FTspectragram::SPECTRAGRAM); break; } else if (source == _inspecPlotSolidTypeButton[i]) { _inputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_SOLID); break; } else if (source == _inspecPlotLineTypeButton[i]) { _inputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_LINES); break; } else if (source == _outspecSpecTypeButton[i]) { _outputSpectragram[i]->setPlotType (FTspectragram::SPECTRAGRAM); break; } else if (source == _outspecPlotSolidTypeButton[i]) { _outputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_SOLID); break; } else if (source == _outspecPlotLineTypeButton[i]) { _outputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_LINES); break; } // all, don't break else if (source == _inspecSpecTypeAllButton) { _inputSpectragram[i]->setPlotType (FTspectragram::SPECTRAGRAM); } else if (source == _inspecPlotSolidTypeAllButton) { _inputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_SOLID); } else if (source == _inspecPlotLineTypeAllButton) { _inputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_LINES); } else if (source == _outspecSpecTypeAllButton) { _outputSpectragram[i]->setPlotType (FTspectragram::SPECTRAGRAM); } else if (source == _outspecPlotSolidTypeAllButton) { _outputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_SOLID); } else if (source == _outspecPlotLineTypeAllButton) { _outputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_LINES); } } updateDisplay(); } void FTmainwin::plot_clicked_events (int button, PixButton * source) { for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; if (source == _inspecSpecTypeButton[i]) { _inputSpectragram[i]->setPlotType (FTspectragram::SPECTRAGRAM); break; } else if (source == _inspecPlotSolidTypeButton[i]) { _inputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_SOLID); break; } else if (source == _inspecPlotLineTypeButton[i]) { _inputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_LINES); break; } else if (source == _outspecSpecTypeButton[i]) { _outputSpectragram[i]->setPlotType (FTspectragram::SPECTRAGRAM); break; } else if (source == _outspecPlotSolidTypeButton[i]) { _outputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_SOLID); break; } else if (source == _outspecPlotLineTypeButton[i]) { _outputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_LINES); break; } // all, don't break else if (source == _inspecSpecTypeAllButton) { _inputSpectragram[i]->setPlotType (FTspectragram::SPECTRAGRAM); } else if (source == _inspecPlotSolidTypeAllButton) { _inputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_SOLID); } else if (source == _inspecPlotLineTypeAllButton) { _inputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_LINES); } else if (source == _outspecSpecTypeAllButton) { _outputSpectragram[i]->setPlotType (FTspectragram::SPECTRAGRAM); } else if (source == _outspecPlotSolidTypeAllButton) { _outputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_SOLID); } else if (source == _outspecPlotLineTypeAllButton) { _outputSpectragram[i]->setPlotType (FTspectragram::AMPFREQ_LINES); } } updateDisplay(); } void FTmainwin::link_clicked_events (int button, PixButton * source) { vector firstprocmods; bool alldone = false; for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; FTspectralEngine *engine = _processPath[i]->getSpectralEngine(); bool done = false; vector procmods; engine->getProcessorModules (procmods); if (i==0) { engine->getProcessorModules (firstprocmods); } int rowcnt=-1; // preincremented below for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { if (filts[m]->getGroup() != lastgroup) { rowcnt++; lastgroup = filts[m]->getGroup(); } if (source == _linkButtons[rowcnt][i]) { FTlinkMenu *menu = new FTlinkMenu (_linkButtons[rowcnt][i], this, engine, filts[m]->getSpecModifierType(), n, m); _linkButtons[rowcnt][i]->PopupMenu (menu, 0, 0); alldone = done = true; break; } else if (source == _linkAllButtons[rowcnt]) { if (_linkAllButtons[rowcnt]->get_active()) { // unlink filts[m]->unlink(); } else if (i != 0) { // link to first path (unless we are the first) filts[m]->link (firstprocmods[n]->getFilter(m)); } else { // unlink we are the master filts[m]->unlink(); } updateGraphs(0, filts[m]->getSpecModifierType()); done = true; } } if (done) break; } if (alldone) break; // if (source == _linkMixButton) { // // toggle it // _linkedMix = (_linkMixButton->GetBackgroundColour() != _activeBg); // } } updateDisplay(); } void FTmainwin::handleLinkButtons (wxCommandEvent &event) { wxObject *source = event.GetEventObject(); vector firstprocmods; bool alldone = false; for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; FTspectralEngine *engine = _processPath[i]->getSpectralEngine(); bool done = false; vector procmods; engine->getProcessorModules (procmods); if (i==0) { engine->getProcessorModules (firstprocmods); } int rowcnt=-1; // preincremented below for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { if (filts[m]->getGroup() != lastgroup) { rowcnt++; lastgroup = filts[m]->getGroup(); } if (source == _linkAllButtons[rowcnt]) { if (_linkAllButtons[rowcnt]->GetBackgroundColour() == _activeBg) { // unlink filts[m]->unlink(); } else if (i != 0) { // link to first path (unless we are the first) filts[m]->link (firstprocmods[n]->getFilter(m)); } else { // unlink we are the master filts[m]->unlink(); } updateGraphs(0, filts[m]->getSpecModifierType()); done = true; } } if (done) break; } if (alldone) break; if (source == _linkMixCheck) { // toggle it _linkedMix = (_linkMixCheck->GetValue()); } } updateDisplay(); } void FTmainwin::handleTitleMenuCmd (FTtitleMenuEvent & ev) { if (ev.ready) { // recieved from title menu selections if (ev.cmdType == FTtitleMenuEvent::RemoveEvt) { doRemoveRow(ev.target); } else if (ev.cmdType == FTtitleMenuEvent::ExpandEvt || ev.cmdType == FTtitleMenuEvent::MinimizeEvt) { doMinimizeExpand(ev.target); } } else { _pendingTitleEvents.push_back ((FTtitleMenuEvent *) ev.Clone()); } } void FTmainwin::doRemoveRow (wxWindow * source) { if (source == _inspecLabelButton || source == _inspecLabelButtonAlt || source == _outspecLabelButton || source == _outspecLabelButtonAlt) { return; } FTspectralEngine *engine = _processPath[0]->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); unsigned int rowcnt=0; int itemi = -1; bool done = false; for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { if (filts[m]->getGroup() == lastgroup) { continue; // first fill do } lastgroup = filts[m]->getGroup(); if (source == _labelButtons[rowcnt] || source == _altLabelButtons[rowcnt]) { itemi = (int) n; done = true; } rowcnt++; } if (done) break; } if (itemi >= 0) { //suspendProcessing(); FTioSupport * iosup = FTioSupport::instance(); // do this for every active process path FTprocessPath * procpath; for (int i=0; i < iosup->getActivePathCount(); ++i) { procpath = iosup->getProcessPath(i); if (!procpath) break; engine = procpath->getSpectralEngine(); engine->removeProcessorModule ((unsigned int) itemi); } rebuildDisplay(false); //restoreProcessing(); if (_procmodDialog && _procmodDialog->IsShown()) { _procmodDialog->refreshState(); } } } void FTmainwin::handleLabelButtons (wxCommandEvent &event) { wxWindow *source = (wxWindow *) event.GetEventObject(); doMinimizeExpand (source); } void FTmainwin::doMinimizeExpand (wxWindow * source) { // remove sash from rowsizer and replace with button int itemi=-1; wxWindow * hidewin=0, *showwin=0; if (source == _inspecLabelButton || source == _inspecLabelButtonAlt) { if (_inspecSash->IsShown()) { hidewin = _inspecSash; showwin = _inspecLabelButtonAlt; itemi = 0; } else { hidewin = _inspecLabelButtonAlt; showwin = _inspecSash; itemi = 0; } } else if (source == _outspecLabelButton || source == _outspecLabelButtonAlt) { if (_outspecSash->IsShown()) { hidewin = _outspecSash; showwin = _outspecLabelButtonAlt; itemi = _rowItems.size()-1; } else { hidewin = _outspecLabelButtonAlt; showwin = _outspecSash; itemi = _rowItems.size()-1; } } else { for (unsigned int n=0; n < _labelButtons.size(); ++n) { if (source == _labelButtons[n] || source == _altLabelButtons[n]) { if (_rowSashes[n]->IsShown()) { hidewin = _rowSashes[n]; showwin = _altLabelButtons[n]; itemi = n+1; } else { hidewin = _altLabelButtons[n]; showwin = _rowSashes[n]; itemi = n+1; } break; } } } minimizeRow (showwin, hidewin, itemi, true); updateAllExtra(); } void FTmainwin::minimizeRow (wxWindow * showwin, wxWindow * hidewin, int itemi, bool layout) { if (hidewin && showwin) { hidewin->Show(false); _rowItems[itemi] = showwin; if (itemi > 0) { _rowItems[itemi]->GetConstraints()->top.Below(_rowItems[itemi-1], 2); } if (itemi < (int) _rowItems.size()-1) { _rowItems[itemi+1]->GetConstraints()->top.Below(_rowItems[itemi], 2); } showwin->Show(true); if (layout) { _rowPanel->Layout(); rowpanelScrollSize(); } } } void FTmainwin::handleSpins (wxSpinEvent &event) { wxObject *source = event.GetEventObject(); if (source == _tempoSpinCtrl) { int tval = _tempoSpinCtrl->GetValue(); for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; // set tempo of all, just in case for (unsigned int n=0; n < _barGraphs.size(); ++n) { _barGraphs[n][i]->setTempo (tval); } _processPath[i]->getSpectralEngine()->setTempo (tval); // purely for saving } } } void FTmainwin::handleChoices (wxCommandEvent &event) { wxObject *source = event.GetEventObject(); if (source == _freqBinsChoice) { int sel = _freqBinsChoice->GetSelection(); // MUST bypass and wait until not working suspendProcessing(); for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; FTspectralEngine *engine = _processPath[i]->getSpectralEngine(); // unset all specmods for safety for (unsigned int n=0; n < _barGraphs.size(); ++n) { _barGraphs[n][i]->setSpectrumModifier(0); _barGraphs[n][i]->setTopSpectrumModifier(0); } engine->setFFTsize ((FTspectralEngine::FFT_Size) (intptr_t) _freqBinsChoice->GetClientData(sel) ); vector procmods; engine->getProcessorModules (procmods); // reset all the activeplots int rowcnt=-1; // preincremented for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { if (filts[m]->getGroup() != lastgroup) { rowcnt++; lastgroup = filts[m]->getGroup(); _barGraphs[rowcnt][i]->setSpectrumModifier(filts[m]); } else { _barGraphs[rowcnt][i]->setTopSpectrumModifier(filts[m]); } } } _inputSpectragram[i]->setDataLength((unsigned int)_processPath[i]->getSpectralEngine()->getFFTsize() >> 1); _outputSpectragram[i]->setDataLength((unsigned int)_processPath[i]->getSpectralEngine()->getFFTsize() >> 1); } restoreProcessing(); updateGraphs(0, ALL_SPECMOD); } else if (source == _overlapChoice) { int sel = _overlapChoice->GetSelection(); for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; _processPath[i]->getSpectralEngine()->setOversamp( (intptr_t) _overlapChoice->GetClientData(sel) ); } } else if (source == _windowingChoice) { int sel = _windowingChoice->GetSelection(); for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; _processPath[i]->getSpectralEngine()->setWindowing( (FTspectralEngine::Windowing) sel ); } } else if (source == _plotSpeedChoice) { int sel = _plotSpeedChoice->GetSelection(); for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; _processPath[i]->getSpectralEngine()->setUpdateSpeed( (FTspectralEngine::UpdateSpeed) (intptr_t) _plotSpeedChoice->GetClientData(sel) ); if (i==0) { _updateMS = 10; // start small _eventTimer->Stop(); _eventTimer->Start(_updateMS, FALSE); } } } else if (source == _superSmoothCheck) { _superSmooth = _superSmoothCheck->GetValue(); if (_superSmooth) { _updateMS = 10; // start small _eventTimer->Stop(); _eventTimer->Start(_updateMS, FALSE); } } else if (source == _maxDelayChoice) { int sel = _maxDelayChoice->GetSelection(); if (sel >= (int) _delayList.size()) return; float maxdelay = _delayList[sel]; // MUST bypass and wait until not working suspendProcessing(); // set the max delay for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; _processPath[i]->getSpectralEngine()->setMaxDelay (maxdelay); // TODO: restore delay graph for (unsigned int n=0; n < _barGraphs.size(); ++n) { _barGraphs[n][i]->refreshBounds(); } } restoreProcessing(); updateGraphs(0, DELAY_SPECMOD); } } void FTmainwin::grid_clicked_events (int button, PixButton * source) { for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; FTspectralEngine *engine = _processPath[i]->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); unsigned int rowcnt=0; bool done = false; for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { // master gridlines buttons if (filts[m]->getGroup() == lastgroup) { continue; // first fill do } lastgroup = filts[m]->getGroup(); if (source == _gridButtons[rowcnt]) { _barGraphs[rowcnt][i]->setGridLines (!_gridButtons[rowcnt]->get_active()); done = true; } else if (source == _gridSnapButtons[rowcnt]) { _barGraphs[rowcnt][i]->setGridSnap (!_gridSnapButtons[rowcnt]->get_active()); done = true; } rowcnt++; } if (done) break; } } updateDisplay(); } void FTmainwin::handleGridButtons (wxCommandEvent &event) { wxObject *source = event.GetEventObject(); for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; FTspectralEngine *engine = _processPath[i]->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); unsigned int rowcnt=0; bool done = false; for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { // master gridlines buttons if (filts[m]->getGroup() == lastgroup) { continue; // first fill do } lastgroup = filts[m]->getGroup(); if (source == _gridButtons[rowcnt]) { _barGraphs[rowcnt][i]->setGridLines (_gridButtons[rowcnt]->GetBackgroundColour() != _activeBg); done = true; } else if (source == _gridSnapButtons[rowcnt]) { _barGraphs[rowcnt][i]->setGridSnap (_gridSnapButtons[rowcnt]->GetBackgroundColour() != _activeBg); done = true; } rowcnt++; } if (done) break; } } updateDisplay(); } void FTmainwin::handleGridButtonMouse (wxMouseEvent &event) { } void FTmainwin::grid_pressed_events (int button, PixButton * source) { if (button != PixButton::RightButton) return; vector graphs; FTspectrumModifier::ModifierType mtype = FTspectrumModifier::NULL_MODIFIER; for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; FTspectralEngine * engine = _processPath[i]->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); unsigned int rowcnt=0; bool done = false; for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { if (filts[m]->getGroup() == lastgroup) { continue; // first will do } lastgroup = filts[m]->getGroup(); if (source == _gridButtons[rowcnt]) { mtype = filts[m]->getModifierType(); graphs.push_back (_barGraphs[rowcnt][i]); done = true; break; } rowcnt++; } if (done) break; } } if (graphs.size() > 0) { FTgridMenu *menu = new FTgridMenu (source, this, graphs, mtype); source->PopupMenu (menu, 0, source->GetSize().GetHeight()); delete menu; } } void FTmainwin::handleTitleButtonMouse (wxMouseEvent &event, bool minimized) { wxWindow *source = (wxWindow *) event.GetEventObject(); FTtitleMenu *menu = new FTtitleMenu (source, this, minimized); source->PopupMenu (menu, 0, source->GetSize().GetHeight()); delete menu; // now repost pending title events // XXX: we do this because one of the actions // actually deletes the source of this event, // and the first pending event was posted in the popupmenu's idle // context. what a pain. for (vector::iterator evt = _pendingTitleEvents.begin(); evt != _pendingTitleEvents.end() ; ++evt) { (*evt)->ready = true; AddPendingEvent (*(*evt)); delete (*evt); } _pendingTitleEvents.clear(); event.Skip(); } void FTmainwin::handleIOButtons (wxCommandEvent &event) { FTioSupport *iosup = FTioSupport::instance(); if (event.GetId() == FT_IOreconnectButton) { if (! iosup->isInited() || (_ioNameText->GetValue() != wxString::FromAscii (iosup->getName()))) { fprintf(stderr, "Reconnecting as %s...\n", static_cast(_ioNameText->GetValue().mb_str())); iosup->stopProcessing(); wxThread::Sleep(200); iosup->close(); iosup->setName (static_cast (_ioNameText->GetValue().mb_str())); if (iosup->init()) { if (iosup->startProcessing()) { iosup->reinit(); } } updateDisplay(); } } else if (event.GetId() == FT_IOdisconnectButton) { if (iosup->isInited()) { iosup->stopProcessing(); wxThread::Sleep(200); iosup->close(); } } } void FTmainwin::rebuildDisplay(bool dolink) { wxWindow *lastsash = _inspecSash; int rowcnt=0; FTspectralEngine * engine = _processPath[0]->getSpectralEngine(); vector pmods; engine->getProcessorModules (pmods); int initrows = _rowSizers.size(); for (unsigned int n=0; n < pmods.size(); ++n) { FTprocI *pm = pmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { // if the group is different from the last // make a new row for it if (filts[m]->getGroup() == lastgroup) { continue; } lastgroup = filts[m]->getGroup(); if (rowcnt >= initrows) { // we need to make new stuff pushProcRow(filts[m]); lastsash = _rowSashes[rowcnt]; } else { wxSashLayoutWindow * sash = _rowSashes[rowcnt]; // main label button string name = filts[m]->getName(); _labelButtons[rowcnt]->SetLabel (wxString::FromAscii (name.c_str())); _labelButtons[rowcnt]->SetToolTip(wxString(wxT("Hide ")) + wxString::FromAscii (name.c_str())); // alt label button _altLabelButtons[rowcnt]->SetLabel (wxString::FromAscii (name.c_str())); _altLabelButtons[rowcnt]->SetToolTip(wxString(wxT("Hide ")) + wxString::FromAscii (name.c_str())); lastsash = sash; } rowcnt++; } } if (rowcnt < (int) _rowSizers.size()) { // we need to pop some rows off int diff = _rowSizers.size() - rowcnt; for (int i=0; i < diff; i++) { //printf ("pop a row off: %d\n", diff); popProcRow(); } } else { //_outspecSash->GetConstraints()->top.SameAs (lastsash, wxBottom, 2); _outspecSash->GetConstraints()->top.Below (lastsash, 2); _outspecLabelButtonAlt->GetConstraints()->top.Below(lastsash, 2); _rowPanel->Layout(); rowpanelScrollSize(); } for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; // shouldnt happen engine = _processPath[i]->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); // change the plot stuff _inputSpectragram[i]->setDataLength((unsigned int)engine->getFFTsize() >> 1); _outputSpectragram[i]->setDataLength((unsigned int)engine->getFFTsize() >> 1); int rowcnt=-1; // preincremented below for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { wxPanel ** rowpanels = 0; FTactiveBarGraph **bargraphs = 0; bool newrow = false; if (filts[m]->getGroup() != lastgroup) { rowcnt++; rowpanels = _subrowPanels[rowcnt]; bargraphs = _barGraphs[rowcnt]; if (!bargraphs[i]) { // only if brand new row rowpanels[i] = new wxPanel (_rowPanels[rowcnt], -1); rowpanels[i]->SetBackgroundColour(*wxBLACK); rowpanels[i]->SetThemeEnabled(false); bargraphs[i] = new FTactiveBarGraph(this, rowpanels[i], -1); newrow = true; } bargraphs[i]->setSpectrumModifier (filts[m]); bargraphs[i]->setTopSpectrumModifier (0); bargraphs[i]->setBypassed (filts[m]->getBypassed()); bargraphs[i]->setTempo(_tempoSpinCtrl->GetValue()); bargraphs[i]->readExtra(filts[m]); bargraphs[i]->refreshBounds(); XMLNode * extra = filts[m]->getExtraNode(); XMLProperty * prop; // get stuff from extra node if ((prop = extra->property ("height"))) { wxString val(wxString::FromAscii (prop->value().c_str())); unsigned long newh; if (val.ToULong (&newh)) { wxLayoutConstraints *cnst = _rowSashes[rowcnt]->GetConstraints(); if (newh < 36) newh = 36; cnst->height.Absolute (newh); } } if ((prop = extra->property ("minimized"))) { wxString val(wxString::FromAscii (prop->value().c_str())); unsigned long newh; if (val.ToULong (&newh)) { if (newh) { // minimize minimizeRow (_altLabelButtons[rowcnt], _rowSashes[rowcnt], rowcnt+1, false); } else { // un-minimize minimizeRow (_rowSashes[rowcnt], _altLabelButtons[rowcnt], rowcnt+1, false); } } } if (dolink) { // link it to first filts[m]->link (pmods[n]->getFilter(m)); } lastgroup = filts[m]->getGroup(); } else { // assign nth filter to already created plot // TODO: support more than 2 rowpanels = _subrowPanels[rowcnt]; bargraphs = _barGraphs[rowcnt]; bargraphs[i]->setTopSpectrumModifier (filts[m]); bargraphs[i]->readExtra(filts[m]); bargraphs[i]->refreshBounds(); if (dolink) { // link it to first filts[m]->link (pmods[n]->getFilter(m)); } continue; } if (newrow) { wxBoxSizer * buttsizer = new wxBoxSizer(wxVERTICAL); PixButton * pixbutt; pixbutt = new PixButton(rowpanels[i], FT_BypassBase, false, wxDefaultPosition, wxSize(_bwidth, -1)); pixbutt->set_normal_bitmap (wxBitmap(bypass_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(bypass_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(bypass_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(bypass_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(bypass_active_xpm)); _bypassButtons[rowcnt][i] = pixbutt; //buttsizer->Add ( _bypassButtons[rowcnt][i] = new wxButton(rowpanels[i], FT_BypassBase, wxT("B"), // wxDefaultPosition, wxSize(_bwidth,-1)), 1, 0,0); pixbutt->clicked.connect (bind (slot (*this, &FTmainwin::bypass_clicked_events), pixbutt)); buttsizer->Add (pixbutt, 0, 0, 0); _bypassButtons[rowcnt][i]->SetFont(_buttFont); _bypassButtons[rowcnt][i]->SetToolTip(wxT("Toggle Bypass")); pixbutt = new PixButton(rowpanels[i], FT_LinkBase, false, wxDefaultPosition, wxSize(_bwidth, -1)); pixbutt->set_normal_bitmap (wxBitmap(link_normal_xpm)); pixbutt->set_selected_bitmap (wxBitmap(link_selected_xpm)); pixbutt->set_focus_bitmap (wxBitmap(link_focus_xpm)); pixbutt->set_disabled_bitmap (wxBitmap(link_disabled_xpm)); pixbutt->set_active_bitmap (wxBitmap(link_active_xpm)); _linkButtons[rowcnt][i] = pixbutt; //buttsizer->Add ( _linkButtons[rowcnt][i] = new wxButton(rowpanels[i], FT_LinkBase, wxT("L"), // wxDefaultPosition, wxSize(_bwidth,-1)), 0, wxTOP,3); buttsizer->Add (_linkButtons[rowcnt][i], 0, wxTOP, 3); _linkButtons[rowcnt][i]->SetFont(_buttFont); _linkButtons[rowcnt][i]->SetToolTip(wxT("Link")); wxBoxSizer * tmpsizer = new wxBoxSizer(wxHORIZONTAL); tmpsizer->Add ( buttsizer, 0, wxALL|wxEXPAND, 1); tmpsizer->Add ( bargraphs[i], 1, wxALL|wxEXPAND, 1); rowpanels[i]->SetAutoLayout(TRUE); tmpsizer->Fit( rowpanels[i] ); rowpanels[i]->SetSizer(tmpsizer); _rowSizers[rowcnt]->Insert (i+1, rowpanels[i], 1, wxLEFT|wxEXPAND, 4); _rowSizers[rowcnt]->Layout(); } } } } //_rowPanel->Layout(); //rowpanelScrollSize(); updateGraphs(0, ALL_SPECMOD); updateDisplay(); if (_blendDialog) { _blendDialog->refreshState(); } } void FTmainwin::handlePathCount (wxCommandEvent &event) { int newcnt = _pathCountChoice->GetSelection() + 1; changePathCount (newcnt, true); } void FTmainwin::changePathCount (int newcnt, bool rebuild, bool ignorelink) { FTioSupport *iosup = FTioSupport::instance(); // change path count if (newcnt < _pathCount) { // get rid of the some for (int i=_pathCount-1; i >= newcnt; i--) { if (!_processPath[i]) continue; // shouldnt happen // remove all stuff // processpath deactivateed in here too removePathStuff(i); } } else if (newcnt > _pathCount) { if (rebuild) { // rebuild first with smaller number rebuildDisplay(!ignorelink); } // add some for (int i=_pathCount; i < newcnt; i++) { // add to io support instance _processPath[i] = iosup->setProcessPathActive (i, true); createPathStuff(i); } } _pathCount = iosup->getActivePathCount(); //printf ("new path cnt = %d\n", _pathCount); if (rebuild) { rebuildDisplay(!ignorelink); } else { updateDisplay(); } } void FTmainwin::updateAllExtra () { FTspectralEngine * engine; // go through each specfilt and get its sash constraint height for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; // shouldnt happen engine = _processPath[i]->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); int rowcnt=-1; // preincremented below for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { wxPanel ** rowpanels = 0; FTactiveBarGraph **bargraphs = 0; if (filts[m]->getGroup() != lastgroup) { rowcnt++; rowpanels = _subrowPanels[rowcnt]; bargraphs = _barGraphs[rowcnt]; FTactiveBarGraph * graph = bargraphs[i]; wxSashLayoutWindow * sash = _rowSashes[rowcnt]; wxLayoutConstraints *cnst = sash->GetConstraints(); XMLNode * extra = filts[m]->getExtraNode(); extra->add_property ("height", std::string (wxString::Format(wxT("%d"), cnst->height.GetValue()).mb_str())); extra->add_property ("minimized", std::string (wxString::Format(wxT("%d"), (int) !sash->IsShown()).mb_str())); //printf ("updating extra for %s : shown %d\n", filts[m]->getName().c_str(), (int) sash->IsShown()); graph->writeExtra (filts[m]); lastgroup = filts[m]->getGroup(); } else { continue; } } } } } void FTmainwin::handleSashDragged (wxSashEvent &event) { wxObject *source = event.GetEventObject(); wxSashLayoutWindow *sash = (wxSashLayoutWindow *) source; if (event.GetDragStatus() == wxSASH_STATUS_OK) { wxLayoutConstraints *cnst = sash->GetConstraints(); wxRect bounds = event.GetDragRect(); int newh = bounds.height; if (newh < 36) newh = 36; cnst->height.Absolute (newh); _rowPanel->Layout(); rowpanelScrollSize(); // update all extra settings updateAllExtra(); } } void FTmainwin::handleGain (wxSpinEvent &event) { wxObject *source = event.GetEventObject(); for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; FTspectralEngine *engine = _processPath[i]->getSpectralEngine(); if (source == _gainSpinCtrl[i]) { // db scale float gain = pow(10, _gainSpinCtrl[i]->GetValue() / 20.0); // printf ("new gain is %g\n", gain); engine->setInputGain(gain); } } } void FTmainwin::handleMixSlider (wxScrollEvent &event) { wxObject *source = event.GetEventObject(); float newval = 1.0; for (int i=0; i < _pathCount; i++) { if (_mixSlider[i] == source) { newval = _mixSlider[i]->GetValue() / 1000.0; break; } } for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; FTspectralEngine *engine = _processPath[i]->getSpectralEngine(); if (_linkedMix || source == _mixSlider[i]) { // 0 -> 1000 engine->setMixRatio( newval); _mixSlider[i]->SetValue( (int) (newval * 1000.0)); } } } void FTmainwin::OnProcMod (wxCommandEvent &event) { // popup our procmod dsp dialog if (!_procmodDialog) { _procmodDialog = new FTprocOrderDialog(this, -1, wxT("DSP Modules")); _procmodDialog->SetSize(372,228); } _procmodDialog->refreshState(); _procmodDialog->Show(true); } void FTmainwin::OnPresetBlend (wxCommandEvent &event) { // popup our preset blend dialog if (!_blendDialog) { _blendDialog = new FTpresetBlendDialog(this, &_configManager, -1, wxT("Preset Blend")); _blendDialog->SetSize(372,228); } _blendDialog->refreshState(); _blendDialog->Show(true); } void FTmainwin::OnModulatorDialog (wxCommandEvent &event) { // popup our modulator dialog if (!_modulatorDialog) { _modulatorDialog = new FTmodulatorDialog(this, -1, wxT("Modulations")); _modulatorDialog->SetSize(450,350); } //_modulatorDialog->refreshState(); _modulatorDialog->Show(true); } void FTmainwin::OnQuit(wxCommandEvent& WXUNUSED(event)) { // TRUE is to force the frame to close Close(TRUE); } void FTmainwin::OnAbout(wxCommandEvent& event) { if (event.GetId() == FT_AboutMenu) { wxString msg(wxString(wxT("FreqTweak ")) + wxString::FromAscii (freqtweak_version) + wxT(" brought to you by Jesse Chappell")); wxMessageBox(msg, wxT("About FreqTweak"), wxOK | wxICON_INFORMATION, this); } else if (event.GetId() == FT_HelpTipsMenu) { FThelpWindow *helpwin = new FThelpWindow(this, -1, wxT("Usage Tips")); helpwin->Show(true); } } void FTmainwin::OnIdle(wxIdleEvent &event) { //printf("OnIdle\n"); if (_superSmooth) { ::wxWakeUpIdle(); } } void FTmainwin::OnClose(wxCloseEvent &event) { cleanup(); event.Skip(); } void FTmainwin::cleanup () { // save default preset _configManager.storeSettings ("", true); //printf ("cleaning up\n"); FTioSupport::instance()->close(); } void FTmainwin::checkEvents() { for (int i=0; i < _pathCount; i++) { if ( ! _updateTokens[i]->getIgnore()) { if (_updateTokens[i]->getUpdated(false)) { updatePlot (i); } else { // auto calibrate _eventTimer->Stop(); _eventTimer->Start(++_updateMS, FALSE); // printf("%d\n", _updateMS); } } } } void FTmainwin::checkRefreshes() { // TODO smartness updateGraphs(0, ALL_SPECMOD, true); } void FTmainwin::updatePlot (int plotid) { FTspectralEngine *engine = _processPath[plotid]->getSpectralEngine(); if (_inspecSash->IsShown()) { const float *inpower = engine->getRunningInputPower(); _inputSpectragram[plotid]->plotNextData(inpower, engine->getFFTsize() >> 1); } if (_outspecSash->IsShown()) { const float *outpower = engine->getRunningOutputPower(); _outputSpectragram[plotid]->plotNextData(outpower, engine->getFFTsize() >> 1); } } void FTmainwin::updateGraphs(FTactiveBarGraph *exclude, SpecModType smtype, bool refreshonly) { for (int i=0; i < _pathCount; i++) { if (!_processPath[i]) continue; FTspectralEngine * engine = _processPath[i]->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); unsigned int rowcnt=0; bool done = false; for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); int lastgroup = -1; for (unsigned int m=0; m < filts.size(); ++m) { if (rowcnt >= _rowSashes.size()) { done = true; break; } if (filts[m]->getGroup() == lastgroup) { continue; // first will do } lastgroup = filts[m]->getGroup(); // prevent too many updates if ((!_rowSashes[rowcnt]->IsShown()) || (refreshonly && !filts[m]->getDirty())) { //cerr << "skipping " << filts[m]->getName() << " dirty: " << filts[m]->getDirty() << " refre: " << refreshonly<< endl; rowcnt++; continue; } if (smtype == ALL_SPECMOD) { //printf ("refreshing %08x\n", (unsigned) _barGraphs[rowcnt][i]); if (refreshonly) { _barGraphs[rowcnt][i]->Refresh(FALSE); } else { _barGraphs[rowcnt][i]->recalculate(); } } else if (filts[m]->getSpecModifierType() == smtype && _barGraphs[rowcnt][i] != exclude) { _barGraphs[rowcnt][i]->Refresh(FALSE); // may not be done //done = true; //break; } rowcnt++; } if (done) break; } } } void FTmainwin::updatePosition(const wxString &freqstr, const wxString &valstr) { wxStatusBar * statBar = GetStatusBar(); if (statBar) { statBar->SetStatusText(freqstr, 1); statBar->SetStatusText(valstr, 2); } } void FTmainwin::handleStoreButton (wxCommandEvent &event) { updateAllExtra(); DEBUGOUT ("store button pressed" << std::endl); _configManager.storeSettings (std::string (_presetCombo->GetValue().mb_str())); if (_blendDialog && _blendDialog->IsShown()) { _blendDialog->refreshState(); } rebuildPresetCombo(); } void FTmainwin::handleLoadButton (wxCommandEvent &event) { DEBUGOUT ("load button pressed" << std::endl); loadPreset (_presetCombo->GetValue().c_str()); } void FTmainwin::loadPreset (const wxString &name, bool uselast) { suspendProcessing(); bool success = _configManager.loadSettings (std::string (name.mb_str()), _restorePortsCheck->GetValue(), uselast); if (success) { _presetCombo->SetValue(name); rebuildPresetCombo(); // this rebuilds changePathCount ( FTioSupport::instance()->getActivePathCount() , true, true); if (_procmodDialog && _procmodDialog->IsShown()) { _procmodDialog->refreshState(); } if (_modulatorDialog && _modulatorDialog->IsShown()) { // _modulatorDialog->refreshState(); } if (_blendDialog && _blendDialog->IsShown()) { _blendDialog->refreshState(name, true, wxT(""), true); } } restoreProcessing(); } void FTmainwin::rebuildPresetCombo() { list namelist = _configManager.getSettingsNames(); wxString selected = _presetCombo->GetValue(); _presetCombo->Clear(); _presetCombo->Append(wxT("")); for (list::iterator name=namelist.begin(); name != namelist.end(); ++name) { _presetCombo->Append(wxString::FromAscii (name->c_str())); } if ( _presetCombo->FindString(selected) >= 0) { _presetCombo->SetValue(selected); } } void FTmainwin::suspendProcessing() { // for (int i=0; i < _pathCount; i++) { // if (!_processPath[i]) continue; // _bypassArray[i] = _processPath[i]->getSpectralEngine()->getBypassed(); // _processPath[i]->getSpectralEngine()->setBypassed(true); // } FTioSupport::instance()->setProcessingBypassed (true); //printf ("suspended before sleep\n"); wxThread::Sleep(250); // sleep to let the process callback get around to the beginning //printf ("suspended after sleep\n"); } void FTmainwin::restoreProcessing() { // restore bypass state // for (int i=0; i < _pathCount; i++) { // if (!_processPath[i]) continue; // _processPath[i]->getSpectralEngine()->setBypassed(_bypassArray[i]); // } FTioSupport::instance()->setProcessingBypassed (false); //printf ("restored\n"); } // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ FTlinkMenu::FTlinkMenu (wxWindow * parent, FTmainwin *win, FTspectralEngine *specengine, SpecModType stype, unsigned int procmodnum, unsigned int filtnum) : wxMenu(), _mwin(win), _specengine(specengine), _stype(stype), _procmodnum(procmodnum), _filtnum(filtnum) { FTspectrumModifier *linkedto = 0; int itemid = 1000; FTspectrumModifier *tempfilt, *thisfilt; FTspectralEngine *tempengine; thisfilt = _specengine->getProcessorModule(procmodnum)->getFilter(filtnum); linkedto = thisfilt->getLink(); for (int i=0; i < FT_MAXPATHS; i++) { if (!_mwin->_processPath[i] || _mwin->_processPath[i]->getSpectralEngine()==_specengine) continue; wxMenuItem * item = 0; tempengine = _mwin->_processPath[i]->getSpectralEngine(); tempfilt = tempengine->getProcessorModule(procmodnum)->getFilter(filtnum); if (linkedto == tempfilt || thisfilt->isLinkedFrom(tempfilt)) { item = new wxMenuItem(this, itemid, wxString::Format(wxT("* Path %d *"), i+1)); } else { item = new wxMenuItem(this, itemid, wxString::Format(wxT("Path %d"), i+1)); } this->Connect( itemid, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &FTlinkMenu::OnLinkItem, new SpecModObject(tempengine)); if (item) { this->Append(item); itemid++; } } // add unlink item wxMenuItem * item = new wxMenuItem(this, itemid, wxT("Unlink")); this->Connect( itemid, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &FTlinkMenu::OnUnlinkItem); this->AppendSeparator (); this->Append (item); } void FTlinkMenu::OnLinkItem(wxCommandEvent &event) { SpecModObject * smobj = (SpecModObject *) event.m_callbackUserData; // this is disaster waiting to happen :) // we need to link all the filters in the same group to their corresponding ones //int group = _specengine->getProcessorModule(_procmodnum)->getFilter(_filtnum)->getGroup(); vector sfilts, dfilts; _specengine->getProcessorModule(_procmodnum)->getFilters (sfilts); smobj->specm->getProcessorModule(_procmodnum)->getFilters (dfilts); for (unsigned int m=0; m < dfilts.size(); ++m) { //if (dfilts[m]->getGroup() == group) { sfilts[m]->link (dfilts[m]); //} } wxMenuItem *item = (wxMenuItem *) event.GetEventObject(); if (item) { this->Disconnect( item->GetId(), wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &FTlinkMenu::OnLinkItem, smobj); } _mwin->updateGraphs(0, _stype); delete smobj; } void FTlinkMenu::OnUnlinkItem(wxCommandEvent &event) { _specengine->getProcessorModule(_procmodnum)->getFilter(_filtnum)->unlink(); wxMenuItem *item = (wxMenuItem *) event.GetEventObject(); if (item) { this->Disconnect( item->GetId(), wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &FTlinkMenu::OnLinkItem); } _mwin->updateGraphs(0, _stype); } BEGIN_EVENT_TABLE(FTgridMenu, wxMenu) EVT_MENU_RANGE (0, 20, FTgridMenu::OnSelectItem) END_EVENT_TABLE() FTgridMenu::FTgridMenu (wxWindow * parent, FTmainwin *win, vector & graphlist, FTspectrumModifier::ModifierType mtype) : wxMenu(), _mwin(win), _graphlist(graphlist), _mtype(mtype) { wxMenuItem * item = 0; vector gridunits = graphlist[0]->getGridChoiceStrings(); unsigned int gindex = graphlist[0]->getGridChoice(); int itemid = 0; for (vector::iterator gridi = gridunits.begin(); gridi != gridunits.end(); ++gridi) { if ( (*gridi).empty()) { // add separator AppendSeparator(); itemid++; } else if ((int)gindex == itemid) { item = new wxMenuItem(this, itemid++, (*gridi) + wxT(" *")); Append (item); } else { item = new wxMenuItem(this, itemid++, *gridi); Append (item); } } } void FTgridMenu::OnSelectItem(wxCommandEvent &event) { wxMenuItem *item = (wxMenuItem *) event.GetEventObject(); if (item) { for (vector::iterator gr = _graphlist.begin(); gr != _graphlist.end(); ++gr) { (*gr)->setGridChoice (event.GetId()); } } } BEGIN_EVENT_TABLE(FTgridButton, wxButton) EVT_RIGHT_DOWN (FTgridButton::handleMouse) END_EVENT_TABLE() FTgridButton::FTgridButton(FTmainwin * mwin, wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) : wxButton(parent, id, label, pos, size, style, validator, name), _mainwin(mwin) { } void FTgridButton::handleMouse(wxMouseEvent &event) { if (event.RightDown()) { _mainwin->handleGridButtonMouse(event); } event.Skip(); } BEGIN_EVENT_TABLE(FTtitleMenu, wxMenu) EVT_MENU_RANGE (0, 20, FTtitleMenu::OnSelectItem) END_EVENT_TABLE() enum { ID_TitleExpand = 0, ID_TitleMinimize, ID_TitleRemove }; FTtitleMenu::FTtitleMenu (wxWindow * parent, FTmainwin *win, bool minimized) : wxMenu(), _mwin(win), _parent(parent) { wxMenuItem * item = 0; if (minimized) { item = new wxMenuItem(this, ID_TitleExpand, wxT("Expand")); } else { item = new wxMenuItem(this, ID_TitleMinimize, wxT("Minimize")); } Append (item); Append (new wxMenuItem(this, ID_TitleRemove, wxT("Remove"))); } void FTtitleMenu::OnSelectItem(wxCommandEvent &event) { int id = event.GetId(); if (id == ID_TitleRemove) { FTtitleMenuEvent tev (0, FTtitleMenuEvent::RemoveEvt, _parent); _mwin->AddPendingEvent (tev); //_mwin->doRemoveRow(_parent); } else if (id == ID_TitleMinimize) { FTtitleMenuEvent tev (0, FTtitleMenuEvent::MinimizeEvt, _parent); _mwin->AddPendingEvent (tev); //_mwin->doMinimizeExpand(_parent); } else if (id == ID_TitleExpand) { FTtitleMenuEvent tev (0, FTtitleMenuEvent::ExpandEvt, _parent); _mwin->AddPendingEvent (tev); //_mwin->doMinimizeExpand(_parent); } } BEGIN_EVENT_TABLE(FTtitleButton, wxButton) EVT_RIGHT_DOWN (FTtitleButton::handleMouse) END_EVENT_TABLE() FTtitleButton::FTtitleButton(FTmainwin * mwin, bool minimized, wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) : wxButton(parent, id, label, pos, size, style, validator, name), _mainwin(mwin), _minimized(minimized) { SetForegroundColour(*wxWHITE); SetBackgroundColour(wxColour(50,50,50)); SetThemeEnabled(false); } void FTtitleButton::handleMouse(wxMouseEvent &event) { if (event.RightDown()) { _mainwin->handleTitleButtonMouse(event, _minimized); } event.Skip(); } freqtweak-0.7.2/src/FTmainwin.hpp0000644000175200017520000003466211226173741015710 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTMAINWIN_HPP__ #define __FTMAINWIN_HPP__ #include using namespace std; #include #include //#include #include #include #include "FTtypes.hpp" #include "FTspectragram.hpp" #include "FTconfigManager.hpp" #include "FTspectrumModifier.hpp" class FTprocessPath; class FTactiveBarGraph; class FTspectralEngine; class FTspectrumModifier; class FTupdateToken; class FTupdateTimer; class FTrefreshTimer; class FTlinkMenu; class FTprocOrderDialog; class FTpresetBlendDialog; class FTmodulatorDialog; namespace JLCui { class PixButton; } BEGIN_DECLARE_EVENT_TYPES() DECLARE_EVENT_TYPE( FT_EVT_TITLEMENU_COMMAND, 9000) END_DECLARE_EVENT_TYPES() #define EVT_TITLEMENU_COMMAND(id, fn) \ DECLARE_EVENT_TABLE_ENTRY( \ FT_EVT_TITLEMENU_COMMAND, id, -1, \ (wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction)&fn, \ (wxObject *) NULL \ ), class FTtitleMenuEvent : public wxCommandEvent { public: enum CmdType { ExpandEvt = 1, MinimizeEvt, RemoveEvt }; FTtitleMenuEvent(int id=0, CmdType ctype=ExpandEvt, wxWindow * targ=0) : wxCommandEvent(FT_EVT_TITLEMENU_COMMAND, id), cmdType(ctype), target(targ), ready(false) { } FTtitleMenuEvent(const FTtitleMenuEvent & ev) : wxCommandEvent(ev), cmdType (ev.cmdType), target (ev.target), ready(ev.ready) { } virtual ~FTtitleMenuEvent() {} wxEvent *Clone(void) const { return new FTtitleMenuEvent(*this); } CmdType cmdType; wxWindow * target; bool ready; private: DECLARE_DYNAMIC_CLASS(FTtitleMenuEvent) }; /** * FTmainWin * */ class FTmainwin : public wxFrame, public SigC::Object { public: // ctor(s) FTmainwin(int startpaths, const wxString& title, const wxString &rcdir , const wxPoint& pos, const wxSize& size); // event handlers (these functions should _not_ be virtual) void OnQuit(wxCommandEvent& event); void OnAbout(wxCommandEvent& event); void OnIdle(wxIdleEvent & event); void OnClose(wxCloseEvent &event); //void OnSize(wxSizeEvent &event); void updateDisplay(); void updateGraphs(FTactiveBarGraph *exclude, SpecModType smtype, bool refreshonly=false); void updatePosition(const wxString &freqstr, const wxString &valstr); void loadPreset (const wxString & name, bool uselast=false); void cleanup (); void handleGridButtonMouse (wxMouseEvent &event); void handleTitleButtonMouse (wxMouseEvent &event, bool minimized); void doMinimizeExpand (wxWindow * source); void doRemoveRow (wxWindow * source); void suspendProcessing(); void restoreProcessing(); void rebuildDisplay(bool dolink=true); FTconfigManager & getConfigManager() { return _configManager; } void normalizeFontSize(wxFont & fnt, int height, wxString fitstr); protected: void buildGui(); void updatePlot(int plotnum); void checkEvents(); void checkRefreshes(); // per path handlers void handleInputButton (wxCommandEvent &event); void handleOutputButton (wxCommandEvent &event); void handleBypassButtons (wxCommandEvent &event); void handleLinkButtons (wxCommandEvent &event); void handleLabelButtons (wxCommandEvent &event); void bypass_clicked_events (int button, JLCui::PixButton *); void link_clicked_events (int button, JLCui::PixButton *); void plot_clicked_events (int button, JLCui::PixButton *); void grid_clicked_events (int button, JLCui::PixButton *); void grid_pressed_events (int button, JLCui::PixButton *); void handlePlotTypeButtons (wxCommandEvent &event); void handleGridButtons (wxCommandEvent &event); void handleChoices (wxCommandEvent &event); void handleSashDragged (wxSashEvent &event); void handleSpins (wxSpinEvent &event); void handleMixSlider (wxScrollEvent &event); void handleGain (wxSpinEvent &event); void handlePathCount (wxCommandEvent &event); void changePathCount (int newcnt, bool rebuild=false, bool ignorelink=false); void handleStoreButton (wxCommandEvent &event); void handleLoadButton (wxCommandEvent &event); void handleIOButtons (wxCommandEvent &event); void OnProcMod (wxCommandEvent &event); void OnPresetBlend (wxCommandEvent &event); void OnModulatorDialog (wxCommandEvent &event); void handleTitleMenuCmd (FTtitleMenuEvent & ev); void rowpanelScrollSize(); void removePathStuff(int i, bool deactivate=true); void createPathStuff(int i); void rebuildPresetCombo(); void pushProcRow(FTspectrumModifier *specmod); void popProcRow(); void updateAllExtra(); void minimizeRow (wxWindow * shown, wxWindow * hidden, int rownum, bool layout=true); FTprocessPath * _processPath[FT_MAXPATHS]; int _startpaths; // overall controls wxChoice * _freqBinsChoice; wxChoice * _overlapChoice; wxChoice * _windowingChoice; wxChoice * _freqScaleChoice; wxSlider * _timescaleSlider; wxChoice * _pathCountChoice; wxTextCtrl * _ioNameText; // array of spectragrams FTspectragram * _inputSpectragram[FT_MAXPATHS]; FTspectragram * _outputSpectragram[FT_MAXPATHS]; vector _barGraphs; // FTactiveBarGraph * _scaleGraph[FT_MAXPATHS]; // FTactiveBarGraph * _freqGraph[FT_MAXPATHS]; // FTactiveBarGraph * _delayGraph[FT_MAXPATHS]; // FTactiveBarGraph * _feedbackGraph[FT_MAXPATHS]; // FTactiveBarGraph * _mashGraph[FT_MAXPATHS]; // FTactiveBarGraph * _gateGraph[FT_MAXPATHS]; //wxButton * _bypassAllButton; //wxButton * _muteAllButton; wxCheckBox * _bypassAllCheck; wxCheckBox * _muteAllCheck; vector _bypassAllButtons; // wxButton * _scaleBypassAllButton; // wxButton * _mashBypassAllButton; // wxButton * _gateBypassAllButton; // wxButton * _freqBypassAllButton; // wxButton * _delayBypassAllButton; // wxButton * _feedbBypassAllButton; vector _linkAllButtons; // wxButton * _scaleLinkAllButton; // wxButton * _mashLinkAllButton; // wxButton * _gateLinkAllButton; // wxButton * _freqLinkAllButton; // wxButton * _delayLinkAllButton; // wxButton * _feedbLinkAllButton; vector _gridButtons; // wxButton * _scaleGridButton; // wxButton * _gateGridButton; // wxButton * _freqGridButton; // wxButton * _delayGridButton; // wxButton * _feedbGridButton; vector _gridSnapButtons; // wxButton * _scaleGridSnapButton; // wxButton * _gateGridSnapButton; // wxButton * _freqGridSnapButton; // wxButton * _delayGridSnapButton; // wxButton * _feedbGridSnapButton; wxButton * _inspecLabelButton; wxButton * _outspecLabelButton; vector _labelButtons; // wxButton * _scaleLabelButton; // wxButton * _mashLabelButton; // wxButton * _gateLabelButton; // wxButton * _freqLabelButton; // wxButton * _delayLabelButton; // wxButton * _feedbLabelButton; wxButton * _inspecLabelButtonAlt; wxButton * _outspecLabelButtonAlt; vector _altLabelButtons; // wxButton * _scaleLabelButtonAlt; // wxButton * _mashLabelButtonAlt; // wxButton * _gateLabelButtonAlt; // wxButton * _freqLabelButtonAlt; // wxButton * _delayLabelButtonAlt; // wxButton * _feedbLabelButtonAlt; JLCui::PixButton * _inspecSpecTypeAllButton; JLCui::PixButton * _inspecPlotSolidTypeAllButton; JLCui::PixButton * _inspecPlotLineTypeAllButton; JLCui::PixButton * _outspecSpecTypeAllButton; JLCui::PixButton * _outspecPlotSolidTypeAllButton; JLCui::PixButton * _outspecPlotLineTypeAllButton; wxCheckBox * _linkMixCheck; //wxButton * _linkMixButton; // per path panels wxPanel * _upperPanels[FT_MAXPATHS]; wxPanel * _inspecPanels[FT_MAXPATHS]; vector _subrowPanels; // wxPanel * _freqPanels[FT_MAXPATHS]; // wxPanel * _scalePanels[FT_MAXPATHS]; // wxPanel * _mashPanels[FT_MAXPATHS]; // wxPanel * _gatePanels[FT_MAXPATHS]; // wxPanel * _delayPanels[FT_MAXPATHS]; // wxPanel * _feedbPanels[FT_MAXPATHS]; wxPanel * _outspecPanels[FT_MAXPATHS]; wxPanel * _lowerPanels[FT_MAXPATHS]; // per path buttons wxButton * _inputButton[FT_MAXPATHS]; wxButton * _outputButton[FT_MAXPATHS]; wxSpinCtrl *_gainSpinCtrl[FT_MAXPATHS]; wxSlider * _mixSlider[FT_MAXPATHS]; //wxButton * _bypassButton[FT_MAXPATHS]; //wxButton * _muteButton[FT_MAXPATHS]; wxCheckBox * _bypassCheck[FT_MAXPATHS]; wxCheckBox * _muteCheck[FT_MAXPATHS]; JLCui::PixButton * _inspecSpecTypeButton[FT_MAXPATHS]; JLCui::PixButton * _inspecPlotSolidTypeButton[FT_MAXPATHS]; JLCui::PixButton * _inspecPlotLineTypeButton[FT_MAXPATHS]; JLCui::PixButton * _outspecSpecTypeButton[FT_MAXPATHS]; JLCui::PixButton * _outspecPlotSolidTypeButton[FT_MAXPATHS]; JLCui::PixButton * _outspecPlotLineTypeButton[FT_MAXPATHS]; vector _bypassButtons; // wxButton * _scaleBypassButton[FT_MAXPATHS]; // wxButton * _mashBypassButton[FT_MAXPATHS]; // wxButton * _gateBypassButton[FT_MAXPATHS]; // wxButton * _freqBypassButton[FT_MAXPATHS]; // wxButton * _delayBypassButton[FT_MAXPATHS]; // wxButton * _feedbBypassButton[FT_MAXPATHS]; vector _linkButtons; // wxButton * _scaleLinkButton[FT_MAXPATHS]; // wxButton * _mashLinkButton[FT_MAXPATHS]; // wxButton * _gateLinkButton[FT_MAXPATHS]; // wxButton * _freqLinkButton[FT_MAXPATHS]; // wxButton * _delayLinkButton[FT_MAXPATHS]; // wxButton * _feedbLinkButton[FT_MAXPATHS]; // sizers wxBoxSizer *_inspecsizer, *_outspecsizer; wxBoxSizer *_inspecbuttsizer, *_outspecbuttsizer; vector _rowSizers; vector _rowButtSizers; wxBoxSizer *_lowersizer, *_uppersizer; wxScrolledWindow *_rowPanel; vector _rowPanels; wxPanel *_inspecPanel, *_outspecPanel; vector _rowSashes; wxSashLayoutWindow *_inspecSash, *_outspecSash; // shown flags bool _inspecShown; vector _shownFlags; // bool _freqShown; // bool _scaleShown; // bool _mashShown; // bool _gateShown; // bool _delayShown; // bool _feedbShown; bool _outspecShown; bool _linkedMix; // bitmap data wxBitmap * _bypassBitmap; wxBitmap * _bypassActiveBitmap; wxBitmap * _linkBitmap; wxBitmap *_linkActiveBitmap; wxColour _defaultBg; wxColour _activeBg; FTupdateTimer *_eventTimer; int _updateMS; bool _superSmooth; FTrefreshTimer *_refreshTimer; int _refreshMS; vector _rowItems; //wxWindow ** _rowItems; int _pathCount; int _rowCount; FTconfigManager _configManager; wxComboBox * _presetCombo; wxChoice * _plotSpeedChoice; wxCheckBox *_superSmoothCheck; wxCheckBox *_restorePortsCheck; wxChoice * _maxDelayChoice; vector _delayList; wxSpinCtrl * _tempoSpinCtrl; FTupdateToken * _updateTokens[FT_MAXPATHS]; bool _bypassArray[FT_MAXPATHS]; FTprocOrderDialog * _procmodDialog; FTpresetBlendDialog * _blendDialog; FTmodulatorDialog * _modulatorDialog; int _bwidth; int _labwidth; int _bheight; int _rowh; wxFont _titleFont; wxFont _titleAltFont; wxFont _buttFont; vector _pendingTitleEvents; friend class FTupdateTimer; friend class FTrefreshTimer; friend class FTlinkMenu; friend class FTgridMenu; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; class FTupdateTimer : public wxTimer { public: FTupdateTimer(FTmainwin *win) : mwin(win) {} void Notify() { mwin->checkEvents(); } FTmainwin *mwin; }; class FTrefreshTimer : public wxTimer { public: FTrefreshTimer(FTmainwin *win) : mwin(win) {} void Notify() { mwin->checkRefreshes(); } FTmainwin *mwin; }; class FTlinkMenu : public wxMenu { public: FTlinkMenu (wxWindow *parent, FTmainwin *win, FTspectralEngine *specmod, SpecModType stype, unsigned int procmodnum, unsigned int filtnum); void OnLinkItem(wxCommandEvent &event); void OnUnlinkItem(wxCommandEvent &event); FTmainwin *_mwin; FTspectralEngine *_specengine; SpecModType _stype; unsigned int _procmodnum; unsigned int _filtnum; class SpecModObject : public wxObject { public: SpecModObject(FTspectralEngine *sm) : specm(sm) {;} FTspectralEngine *specm; }; private: // any class wishing to process wxWindows events must use this macro // DECLARE_EVENT_TABLE() }; class FTgridMenu : public wxMenu { public: FTgridMenu (wxWindow *parent, FTmainwin *win, vector & graph, FTspectrumModifier::ModifierType mtype); void OnSelectItem(wxCommandEvent &event); FTmainwin *_mwin; vector _graphlist; FTspectrumModifier::ModifierType _mtype; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; class FTgridButton : public wxButton { public: FTgridButton(FTmainwin *mwin, wxWindow * parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator=wxDefaultValidator, const wxString& name = wxButtonNameStr); void handleMouse (wxMouseEvent &event); FTmainwin * _mainwin; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; class FTtitleMenu : public wxMenu { public: FTtitleMenu (wxWindow *parent, FTmainwin *win, bool minimized); void OnSelectItem(wxCommandEvent &event); FTmainwin *_mwin; wxWindow * _parent; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; class FTtitleButton : public wxButton { public: FTtitleButton(FTmainwin *mwin, bool minimized, wxWindow * parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator=wxDefaultValidator, const wxString& name = wxButtonNameStr); void handleMouse (wxMouseEvent &event); FTmainwin * _mainwin; bool _minimized; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; #endif freqtweak-0.7.2/src/LockMonitor.hpp0000644000175200017520000000621211226173741016242 0ustar develdevel/* Copyright (C) 2000 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. $Id: LockMonitor.hpp,v 1.2 2004/04/22 08:16:16 essej Exp $ */ #ifndef __pbd_lockmonitor_h__ #define __pbd_lockmonitor_h__ #include #undef DEBUG_LOCK_MONITOR #ifdef DEBUG_LOCK_MONITOR #include #include "cycles.h" #endif namespace PBD { class Lock { public: Lock() { pthread_mutex_init (&_mutex, 0); } virtual ~Lock() {} virtual int lock () { return pthread_mutex_lock (&_mutex); } virtual int unlock() { return pthread_mutex_unlock (&_mutex); } pthread_mutex_t *mutex() { return &_mutex; } protected: pthread_mutex_t _mutex; }; class NonBlockingLock : public Lock { public: NonBlockingLock() {} ~NonBlockingLock(){} int lock () { return pthread_mutex_lock (&_mutex); } int trylock () { return pthread_mutex_trylock (&_mutex); } int unlock() { return pthread_mutex_unlock (&_mutex); } }; class LockMonitor { public: LockMonitor (Lock& lck, unsigned long l, const char *f) : lock (lck) #ifdef DEBUG_LOCK_MONITOR , line (l), file (f) #endif { #ifdef DEBUG_LOCK_MONITOR unsigned long long when; when = get_cycles(); std::cerr << when << " lock " << &lock << " at " << line << " in " << file << std::endl; #endif lock.lock (); #ifdef DEBUG_LOCK_MONITOR when = get_cycles(); std::cerr << '\t' << when << " locked at " << &lock << " at " << line << " in " << file << std::endl; #endif } ~LockMonitor () { lock.unlock (); } private: Lock& lock; #ifdef DEBUG_LOCK_MONITOR unsigned long line; const char * file; #endif }; class TentativeLockMonitor { public: TentativeLockMonitor (NonBlockingLock& lck, unsigned long l, const char *f) : lock (lck) #ifdef DEBUG_LOCK_MONITOR , line (l), file (f) #endif { #ifdef DEBUG_LOCK_MONITOR unsigned long long when; when = get_cycles(); std::cerr << when << " tentative lock " << &lock << " at " << line << " in " << file << std::endl; #endif _locked = (lock.trylock() == 0); #ifdef DEBUG_LOCK_MONITOR when = get_cycles(); std::cerr << '\t' << when << ' ' << _locked << " at " << &lock << " at " << line << " in " << file << std::endl; #endif } ~TentativeLockMonitor () { if (_locked) { lock.unlock (); } } bool locked() { return _locked; } private: NonBlockingLock& lock; bool _locked; #ifdef DEBUG_LOCK_MONITOR unsigned long line; const char * file; #endif }; } /* namespace */ #endif /* __pbd_lockmonitor_h__*/ freqtweak-0.7.2/src/RingBuffer.cpp0000644000175200017520000000706411226173741016034 0ustar develdevel/* Copyright (C) 2000 Paul Barton-Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. $Id: RingBuffer.cpp,v 1.2 2004/11/10 17:16:08 trutkin Exp $ */ #if HAVE_CONFIG_H #include #endif #include #include #include #include "RingBuffer.hpp" RingBuffer::~RingBuffer () { if (mlocked) { munlock (buf, size); } delete [] buf; } size_t RingBuffer::read (char *dest, size_t cnt) { size_t free_cnt; size_t cnt2; size_t to_read; size_t n1, n2; if ((free_cnt = read_space ()) == 0) { return 0; } to_read = cnt > free_cnt ? free_cnt : cnt; cnt2 = read_ptr + to_read; if (cnt2 > size) { n1 = size - read_ptr; n2 = cnt2 & size_mask; } else { n1 = to_read; n2 = 0; } memcpy (dest, &buf[read_ptr], n1); read_ptr += n1; read_ptr &= size_mask; if (n2) { memcpy (dest+n1, &buf[read_ptr], n2); read_ptr += n2; read_ptr &= size_mask; } return to_read; } size_t RingBuffer::write (char *src, size_t cnt) { size_t free_cnt; size_t cnt2; size_t to_write; size_t n1, n2; if ((free_cnt = write_space ()) == 0) { return 0; } to_write = cnt > free_cnt ? free_cnt : cnt; cnt2 = write_ptr + to_write; if (cnt2 > size) { n1 = size - write_ptr; n2 = cnt2 & size_mask; } else { n1 = to_write; n2 = 0; } memcpy (&buf[write_ptr], src, n1); write_ptr += n1; write_ptr &= size_mask; if (n2) { memcpy (&buf[write_ptr], src+n1, n2); write_ptr += n2; write_ptr &= size_mask; } return to_write; } int RingBuffer::mlock () { if (::mlock (buf, size)) { return -1; } mlocked = true; return 0; } void RingBuffer::mem_set ( char val) { ::memset ( buf, val, size ); } void RingBuffer::get_read_vector (rw_vector *vec) { size_t free_cnt; size_t cnt2; size_t w, r; w = write_ptr; r = read_ptr; if (w > r) { free_cnt = w - r; } else { free_cnt = (w - r + size) & size_mask; } cnt2 = r + free_cnt; if (cnt2 > size) { /* Two part vector: the rest of the buffer after the current write ptr, plus some from the start of the buffer. */ vec[0].buf = &buf[r]; vec[0].len = size - r; vec[1].buf = buf; vec[1].len = cnt2 & size_mask; } else { /* Single part vector: just the rest of the buffer */ vec[0].buf = &buf[r]; vec[0].len = free_cnt; vec[1].len = 0; } } void RingBuffer::get_write_vector (rw_vector *vec) { size_t free_cnt; size_t cnt2; size_t w, r; w = write_ptr; r = read_ptr; if (w > r) { free_cnt = ((r - w + size) & size_mask) - 1; } else if (w < r) { free_cnt = (r - w) - 1; } else { free_cnt = size - 1; } cnt2 = w + free_cnt; if (cnt2 > size) { /* Two part vector: the rest of the buffer after the current write ptr, plus some from the start of the buffer. */ vec[0].buf = &buf[w]; vec[0].len = size - w; vec[1].buf = buf; vec[1].len = cnt2 & size_mask; } else { vec[0].buf = &buf[w]; vec[0].len = free_cnt; vec[1].len = 0; } } freqtweak-0.7.2/src/RingBuffer.hpp0000644000175200017520000000465111226173741016040 0ustar develdevel/* Copyright (C) 2000 Paul Barton-Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. $Id: RingBuffer.hpp,v 1.1.1.1 2002/10/13 04:13:34 essej Exp $ */ #ifndef __pbd_ringbuffer_h__ #define __pbd_ringbuffer_h__ #include class RingBuffer { public: RingBuffer (int sz) { int power_of_two; for (power_of_two = 1; 1< r) { return ((r - w + size) & size_mask) - 1; } else if (w < r) { return (r - w) - 1; } else { return size - 1; } } size_t read_space () { size_t w, r; w = write_ptr; r = read_ptr; if (w > r) { return w - r; } else { return (w - r + size) & size_mask; } } protected: char *buf; volatile size_t write_ptr; volatile size_t read_ptr; size_t size; size_t size_mask; bool mlocked; }; #endif /* __pbd_ringbuffer_h__ */ freqtweak-0.7.2/src/FTutils.cpp0000644000175200017520000006500711226173741015376 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** and Jay Gibble ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include "FTutils.hpp" #include #include #include #include #include using namespace std; /* * Please excuse all the macros. * They are used for explicit inlining of * the "vector" versions of these functions. */ /* Logarithm base-10. */ /* absolute error < 6.4e-4 */ /* input must be > 0 */ float FTutils::fast_log10 (float x) { /******************************************************************/ /* strategy: factor x into */ /* 2^k * xprime */ /* (where xprime is in the interval [1, 2)) */ /* and compute log2 of both parts. */ /* */ /* (Then convert to log10.) */ /* */ /* a) log2 of 2^k is k (exact) */ /* b) log2 of xprime is approximated with */ /* a minimax polynomial. */ /* */ /* The answer is the sum of the answers (a) and (b). */ /* */ /* The approximation used for (b) yields max error of */ /* 6.4e-4 over the interval [1, 2) */ /******************************************************************/ /* minimax approximation courtesy of MAPLE */ /* invocation: */ /* > with('numapprox'); */ /* > y := minimax(log(x)/log(2), 1..2, [3,0], 1, 'maxerror'); */ /* > maxerror; */ #define FAST_LOG10_PREFACE \ \ /* coefficient to convert from log2 to log10 */ \ static const float log10_2 = 0.3010299957; \ \ /* coefficients for polynomial approximation */ \ static const float c0 = -2.153620718; \ static const float c1 = 3.047884161; \ static const float c2 = -1.051875031; \ static const float c3 = 0.1582487046; \ \ float ans = 0; \ \ \ /* "bits" representation of the argument "x" */ \ uint32_t* xbits = (uint32_t*)&x; \ \ /* exponent of IEEE float */ \ int expo; \ FAST_LOG10_PREFACE #define FAST_LOG10_BODY \ /* get the IEEE float exponent and debias */ \ expo = (int) (*xbits >> 23) - 127; \ \ /* force the exponent of x to zero */ \ /* (range reduction to [1, 2)): */ \ *xbits &= 0x007fffff; \ *xbits += 0x3f800000; \ \ /* do the polynomial approximation */ \ ans = c0 + (c1 + (c2 + c3 * x) * x) * x; \ \ /* add the log2(2^k) term */ \ ans += expo; \ \ /******************************************/ \ /* convert to log10 */ \ /******************************************/ \ ans *= log10_2; \ FAST_LOG10_BODY return ans; } /* Logarithm base-10. */ /* absolute error < 6.4e-4 */ /* input must be > 0 */ float FTutils::fast_log2 (float x) { /******************************************************************/ /* strategy: factor x into */ /* 2^k * xprime */ /* (where xprime is in the interval [1, 2)) */ /* and compute log2 of both parts. */ /* */ /* a) log2 of 2^k is k (exact) */ /* b) log2 of xprime is approximated with */ /* a minimax polynomial. */ /* */ /* The answer is the sum of the answers (a) and (b). */ /* */ /* The approximation used for (b) yields max error of */ /* 6.4e-4 over the interval [1, 2) */ /******************************************************************/ /* minimax approximation courtesy of MAPLE */ /* invocation: */ /* > with('numapprox'); */ /* > y := minimax(log(x)/log(2), 1..2, [3,0], 1, 'maxerror'); */ /* > maxerror; */ #define FAST_LOG2_PREFACE \ \ /* coefficients for polynomial approximation */ \ static const float c0 = -2.153620718; \ static const float c1 = 3.047884161; \ static const float c2 = -1.051875031; \ static const float c3 = 0.1582487046; \ \ float ans = 0; \ \ \ /* "bits" representation of the argument "x" */ \ uint32_t* xbits = (uint32_t*)&x; \ \ /* exponent of IEEE float */ \ int expo; \ FAST_LOG2_PREFACE #define FAST_LOG2_BODY \ /* get the IEEE float exponent and debias */ \ expo = (int) (*xbits >> 23) - 127; \ \ /* force the exponent of x to zero */ \ /* (range reduction to [1, 2)): */ \ *xbits &= 0x007fffff; \ *xbits += 0x3f800000; \ \ /* do the polynomial approximation */ \ ans = c0 + (c1 + (c2 + c3 * x) * x) * x; \ \ /* add the log2(2^k) term */ \ ans += expo; \ FAST_LOG2_BODY return ans; } /* Fourth root. */ /* relative error < 0.06% */ /* input must be >= 0 */ float FTutils::fast_fourth_root (float x) { /******************************************************************/ /* strategy: factor x into */ /* 2^(4k) * 2^({0,1,2,3}) * xprime */ /* (where xprime is in the interval [1/2, 1)) */ /* and compute the fourth root */ /* on each of the three parts. */ /* */ /* a) The fourth root of 2^(4k) is 2^k */ /* b) The fourth root of 2^({0,1,2,3}) is saved in a lookup table */ /* c) The fourth root of xprime is approximated with */ /* a minimax polynomial. */ /* */ /* The answer is the product of the answers from (a),(b) and (c) */ /* */ /* The approximation used for (c) yields max error of */ /* 5.2e-4 over the interval [1/2, 1) */ /* */ /* Relative error is always < 0.06% */ /******************************************************************/ /* minimax approximations courtesy of MAPLE */ /* invocation: */ /* > with('numapprox'); */ /* > y := minimax(x->(x^0.25), 0.5..1, [2,0], 1, 'maxerror'); */ /* > maxerror; */ #define FAST_FOURTH_ROOT_PREFACE \ \ /* table of fourth roots of small powers of 2 */ \ static const float fourth_root_pow_2[] = \ { \ 1.0, /* 1^(1/4) */ \ 1.189207115, /* 2^(1/4) */ \ 1.414213562, /* 4^(1/4) */ \ 1.681792831 /* 8^(1/4) */ \ }; \ \ /* 2nd degree poly: */ \ /* max error = 5.2e-4 */ \ /* y := x -> 0.6011250669 + */ \ /* (0.5627811782 - 0.1644203886 x) x */ \ static const float c0 = 0.6011250669; \ static const float c1 = 0.5627811782; \ static const float c2 = -0.1644203886; \ \ /* 3rd degree poly: */ \ /* max error = 6.1e-5 */ \ /* y := x -> 0.5511182600 + (0.7764109321 + */ \ /* (-0.4594631650 + 0.1319948485 x) x) x */ \ \ /* 4th degree poly: */ \ /* max error = 7.8e-6 */ \ /* y := x -> 0.5167374448 + */ \ /* (0.9719985167 + (-0.8683104381 + */ \ /* (0.5043560567 - 0.1247894259 x) x) x) x */ \ \ \ /* "bits" representation of argument x */ \ uint32_t* xbits = (uint32_t*) &x; \ \ /* factor of 2^(4k) */ \ float two_to_4k = 1.0; \ /* bits representation */ \ int* two_to_4k_bits = (int *) &two_to_4k; \ \ /* exponent of IEEE float */ \ int expo; \ /* remainder of "expo" after dividing out factor of 2^(4k) */ \ int expo_rem; \ \ /* result */ \ float ans; \ FAST_FOURTH_ROOT_PREFACE #define FAST_FOURTH_ROOT_BODY \ /* get the IEEE float exponent and debias */ \ /* (assuming non-negative sign bit) */ \ /* NOTE: we are debiasing to a reference point of 2^(-1) */ \ expo = (int) (*xbits >> 23) - 126; \ /* get the remainder after division of exponent by 4 */ \ expo_rem = expo & 0x03; \ /* do the division by 4 */ \ expo >>= 2; \ /* rebias and shift back up to make an IEEE float */ \ *two_to_4k_bits = (expo + 127) << 23; \ \ /* force the exponent of x to -1 */ \ /* (range reduction to [1/2, 1): */ \ \ /* mask out any exponent bits */ \ *xbits &= 0x007FFFFF; \ /* "0x3F000000" is the exponent for 2^(-1) (=126) shifted left by 23 */ \ *xbits += 0x3F000000; \ \ /* do the polynomial approximation */ \ ans = c0 + (c1 + c2 * x) * x; \ \ /* include the other factors */ \ ans *= fourth_root_pow_2 [expo_rem]; \ ans *= two_to_4k; \ FAST_FOURTH_ROOT_BODY return ans; } /* Square root. */ /* relative error < 0.08% */ /* input must be >= 0 */ float FTutils::fast_square_root (float x) { /******************************************************************/ /* strategy: factor x into */ /* 2^(2k) * 2^({0,1}) * xprime */ /* (where xprime is in the interval [1/2, 1)) */ /* and compute the square root */ /* on each of the three parts. */ /* */ /* a) The square root of 2^(2k) is 2^k */ /* b) The square root of 2^({0,1}) is saved in a lookup table */ /* c) The square root of xprime is approximated with */ /* a minimax polynomial. */ /* */ /* The answer is the product of the answers from (a),(b) and (c) */ /* */ /* The approximation used for (c) yields max error of */ /* 5.4e-4 over the interval [1/2, 1) */ /* */ /* Relative error is always < 0.08% */ /******************************************************************/ /* minimax approximations courtesy of MAPLE */ /* invocation: */ /* > with('numapprox'); */ /* > y := minimax(x->(x^0.5), 0.5..1, [2,0], 1, 'maxerror'); */ /* > maxerror; */ #define FAST_SQUARE_ROOT_PREFACE \ \ /* table of square roots of small powers of 2 */ \ static const float square_root_pow_2[] = \ { \ 1.0, /* 1^(1/2) */ \ 1.414213562 /* 2^(1/2) */ \ }; \ \ /* 2nd degree poly: */ \ /* max error = 5.4e-4 */ \ /* y := x -> 0.3151417738 + */ \ /* (0.8856989002 - 0.2013800934 x) x */ \ static const float c0 = 0.3151417738; \ static const float c1 = 0.8856989002; \ static const float c2 = -0.2013800934; \ \ \ /* "bits" representation of argument x */ \ uint32_t* xbits = (uint32_t*) &x; \ \ /* factor of 2^(2k) */ \ float two_to_2k = 1.0; \ /* bits representation */ \ int* two_to_2k_bits = (int *) &two_to_2k; \ \ /* exponent of IEEE float */ \ int expo; \ /* remainder of "expo" after dividing out factor of 2^(4k) */ \ int expo_rem; \ \ /* result */ \ float ans; \ FAST_SQUARE_ROOT_PREFACE #define FAST_SQUARE_ROOT_BODY \ \ /* get the IEEE float exponent and debias */ \ /* (assuming non-negative sign bit) */ \ /* NOTE: we are debiasing to a reference point of 2^(-1) */ \ expo = (int) (*xbits >> 23) - 126; \ /* get the remainder after division of exponent by 2 */ \ expo_rem = expo & 0x01; \ /* do the division by 2 */ \ expo >>= 1; \ /* rebias and shift back up to make an IEEE float */ \ *two_to_2k_bits = (expo + 127) << 23; \ \ /* force the exponent of x to -1 */ \ /* (range reduction to [1/2, 1): */ \ \ /* mask out any exponent bits */ \ *xbits &= 0x007FFFFF; \ /* "0x3F000000" is the exponent for 2^(-1) (=126) shifted left by 23 */ \ *xbits += 0x3F000000; \ \ /* do the polynomial approximation */ \ ans = c0 + (c1 + c2 * x) * x; \ \ /* include the other factors */ \ ans *= square_root_pow_2 [expo_rem]; \ ans *= two_to_2k; \ FAST_SQUARE_ROOT_BODY return ans; } /******************************************************************************/ /* here are some explicitly inlined vector versions */ /******************************************************************************/ void FTutils::vector_fast_log10 (const float* x_input, float* y_output, int N) { int i; float x; FAST_LOG10_PREFACE; for (i=0; i ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTUTILS_HPP__ #define __FTUTILS_HPP__ #include #include #include //#include #if 0 # define DEBUGOUT(x) (std::cout << __FILE__ << ":" << __LINE__ << ":" << __FUNCTION__ << ": " << x) #else # define DEBUGOUT(x) ; #endif class FTutils { public: /* Rough but quick versions of some basic math functions */ /* There is no input error checking. */ /* Logarithm base-10. */ /* absolute error < 6.4e-4 */ /* input must be > 0 */ static float fast_log10 (float x); /* Logarithm base-2. */ /* absolute error < 6.4e-4 */ /* input must be > 0 */ static float fast_log2 (float x); /* Square root. */ /* relative error < 0.08% */ /* input must be >= 0 */ static float fast_square_root (float x); /* Fourth root. */ /* relative error < 0.06% */ /* input must be >= 0 */ static float fast_fourth_root (float x); /* vector versions of the above. */ /* "in" and "out" pointer can refer */ /* to the same array for in-place */ /* computation */ static void vector_fast_log2 (const float* x_input, float* y_output, int N); static void vector_fast_log10 (const float* x_input, float* y_output, int N); static void vector_fast_square_root (const float* x_input, float* y_output, int N); static void vector_fast_fourth_root (const float* x_input, float* y_output, int N); static inline float powerLogScale(float yval, float min); static inline float f_clamp(float x, float a, float b) { const float x1 = std::fabs(x - a); const float x2 = std::fabs(x - b); x = x1 + a + b; x -= x2; x *= 0.5; return x; } /* these are not too cheap */ static double sine_wave (double time, double freq_Hz); static double square_wave (double time, double freq_Hz); static double triangle_wave (double time, double freq_Hz); }; inline float FTutils::powerLogScale(float yval, float min) { if (yval <= min) { return -200.0; } // if (yval > _maxval) { // _maxval = yval; // } //float nval = (10.0 * FTutils::fast_log10(yval / max)); float nval = (10.0 * FTutils::fast_log10 (yval)); // printf ("scaled value is %g mincut=%g\n", nval, _minCutoff); return nval; } /* 32 bit "pointer cast" union */ typedef union { float f; int32_t i; } ls_pcast32; static inline float flush_to_zero(float f) { ls_pcast32 v; v.f = f; // original: return (v.i & 0x7f800000) == 0 ? 0.0f : f; // version from Tim Blechmann return (v.i & 0x7f800000) < 0x08000000 ? 0.0f : f; } /* A set of branchless clipping operations from Laurent de Soras */ static inline float f_max(float x, float a) { x -= a; x += fabsf(x); x *= 0.5; x += a; return x; } static inline float f_min(float x, float b) { x = b - x; x += fabsf(x); x *= 0.5; x = b - x; return x; } static inline float f_clamp(float x, float a, float b) { const float x1 = fabsf(x - a); const float x2 = fabsf(x - b); x = x1 + a + b; x -= x2; x *= 0.5; return x; } struct LocaleGuard { LocaleGuard (const char*); ~LocaleGuard (); const char* old; }; #define DB_CO(g) ((g) > -90.0f ? pow(10.0, (g) * 0.05) : 0.0) #define CO_DB(v) (20.0 * log10(v)) #endif freqtweak-0.7.2/src/FTmodRotate.cpp0000644000175200017520000001172011226173741016165 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTmodRotate.hpp" #include #include #include using namespace std; using namespace PBD; FTmodRotate::FTmodRotate (nframes_t samplerate, unsigned int fftn) : FTmodulatorI ("Rotate", "Rotate", samplerate, fftn) { } FTmodRotate::FTmodRotate (const FTmodRotate & other) : FTmodulatorI ("Rotate", "Rotate", other._sampleRate, other._fftN) { } void FTmodRotate::initialize() { _lastframe = 0; _rate = new Control (Control::FloatType, "rate", "Rate", "Hz/sec"); _rate->_floatLB = -((float) _sampleRate); _rate->_floatUB = (float) _sampleRate; _rate->setValue (0.0f); _controls.push_back (_rate); _minfreq = new Control (Control::FloatType, "min_freq", "Min Freq", "Hz"); _minfreq->_floatLB = 0.0; _minfreq->_floatUB = _sampleRate / 2; _minfreq->setValue (_minfreq->_floatLB); _controls.push_back (_minfreq); _maxfreq = new Control (Control::FloatType, "max_freq", "Max Freq", "Hz"); _maxfreq->_floatLB = 0.0; _maxfreq->_floatUB = _sampleRate / 2; _maxfreq->setValue (_maxfreq->_floatUB); _controls.push_back (_maxfreq); // _dimension = new Control (Control::EnumType, "Target", ""); // _dimension->_enumList.push_back("Frequency"); // _dimension->_enumList.push_back("Value"); // _dimension->setValue ("Frequency"); // _controls.push_back (_dimension); _tmpfilt = new float[_fftN]; _inited = true; } FTmodRotate::~FTmodRotate() { if (!_inited) return; _controls.clear(); delete _rate; delete _minfreq; delete _maxfreq; } void FTmodRotate::setFFTsize (unsigned int fftn) { _fftN = fftn; if (_inited) { delete _tmpfilt; _tmpfilt = new float[_fftN]; } } void FTmodRotate::modulate (nframes_t current_frame, fft_data * fftdata, unsigned int fftn, sample_t * timedata, nframes_t nframes) { TentativeLockMonitor lm (_specmodLock, __LINE__, __FILE__); if (!lm.locked() || !_inited || _bypassed) return; float rate = 1.0; float ub,lb; float * filter; int len; int i,j; float minfreq, maxfreq; int minbin, maxbin; double hzperbin; // in hz/sec _rate->getValue (rate); _minfreq->getValue (minfreq); _maxfreq->getValue (maxfreq); if (minfreq >= maxfreq) { return; } hzperbin = _sampleRate / (double) fftn; // shiftval (bins) = deltasamples / (samp/sec) * (hz/sec) / (hz/bins) // bins = sec * hz/sec int shiftval = (int) (((current_frame - _lastframe) / (double) _sampleRate) * rate / hzperbin); if (current_frame != _lastframe && shiftval != 0) { // fprintf (stderr, "shift at %lu : samps=%g s*c=%g s*e=%g \n", (unsigned long) current_frame, samps, (current_frame/samps), ((current_frame + nframes)/samps) ); for (SpecModList::iterator iter = _specMods.begin(); iter != _specMods.end(); ++iter) { FTspectrumModifier * sm = (*iter); if (sm->getBypassed()) continue; // cerr << "shiftval is: " << shiftval // << " hz/bin: " << hzperbin // << " rate: " << rate << endl; filter = sm->getValues(); sm->getRange(lb, ub); len = (int) sm->getLength(); minbin = (int) ((minfreq*2/ _sampleRate) * len); maxbin = (int) ((maxfreq*2/ _sampleRate) * len); len = maxbin - minbin; if (len <= 0) { continue; } int shiftbins = (abs(shiftval) % len) * (shiftval > 0 ? 1 : -1); // fprintf(stderr, "shifting %d %d:%d at %lu\n", shiftbins, minbin, maxbin, (unsigned long) current_frame); if (shiftbins > 0) { // shiftbins is POSITIVE, shift right // store last shiftbins for (i=maxbin-shiftbins; i < maxbin; i++) { _tmpfilt[i] = filter[i]; } for ( i=maxbin-1; i >= minbin + shiftbins; i--) { filter[i] = filter[i-shiftbins]; } for (j=maxbin-shiftbins, i=minbin; i < minbin + shiftbins; i++, j++) { filter[i] = _tmpfilt[j]; } } else if (shiftbins < 0) { // shiftbins is NEGATIVE, shift left // store last shiftbins // store first shiftbins for (i=minbin; i < minbin-shiftbins; i++) { _tmpfilt[i] = filter[i]; } for (i=minbin; i < maxbin + shiftbins; i++) { filter[i] = filter[i-shiftbins]; } for (j=minbin, i=maxbin+shiftbins; i < maxbin; i++, j++) { filter[i] = _tmpfilt[j]; } } sm->setDirty(true); } _lastframe = current_frame; } } freqtweak-0.7.2/src/FTmodRotate.hpp0000644000175200017520000000262411226173741016175 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTMODROTATE_HPP__ #define __FTMODROTATE_HPP__ #include "FTmodulatorI.hpp" class FTmodRotate : public FTmodulatorI { public: FTmodRotate(nframes_t samplerate, unsigned int fftn); FTmodRotate (const FTmodRotate & other); virtual ~FTmodRotate(); FTmodulatorI * clone() { return new FTmodRotate(*this); } void initialize(); void modulate (nframes_t current_frame, fft_data * fftdata, unsigned int fftn, sample_t * timedata, nframes_t nframes); void setFFTsize (unsigned int fftn); protected: Control * _rate; Control * _minfreq; Control * _maxfreq; nframes_t _lastframe; float * _tmpfilt; }; #endif freqtweak-0.7.2/src/FTprocPitch.cpp0000644000175200017520000001176511226200402016154 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include #include "FTprocPitch.hpp" #include "FTutils.hpp" #include FTprocPitch::FTprocPitch (nframes_t samprate, unsigned int fftn) : FTprocI("Pitch", samprate, fftn) { _confname = "Pitch"; } FTprocPitch::FTprocPitch (const FTprocPitch & other) : FTprocI (other._name, other._sampleRate, other._fftN) { _confname = "Pitch"; } void FTprocPitch::initialize() { // create filter _filter = new FTspectrumModifier("Pitch", "scale", 0, FTspectrumModifier::SEMITONE_MODIFIER, SCALE_SPECMOD, _fftN/2, 1.0); _filter->setRange(0.5, 2.0); _filter->setBypassed(true); // by default _filterlist.push_back (_filter); gLastPhase = new float [FT_MAX_FFT_SIZE]; gSumPhase = new float [FT_MAX_FFT_SIZE]; gAnaFreq = new float [FT_MAX_FFT_SIZE]; gSynFreq = new float [FT_MAX_FFT_SIZE]; gAnaMagn = new float [FT_MAX_FFT_SIZE]; gSynMagn = new float [FT_MAX_FFT_SIZE]; memset(gLastPhase, 0, FT_MAX_FFT_SIZE*sizeof(float)); memset(gSumPhase, 0, FT_MAX_FFT_SIZE*sizeof(float)); memset(gAnaFreq, 0, FT_MAX_FFT_SIZE*sizeof(float)); memset(gSynFreq, 0, FT_MAX_FFT_SIZE*sizeof(float)); memset(gAnaMagn, 0, FT_MAX_FFT_SIZE*sizeof(float)); memset(gSynMagn, 0, FT_MAX_FFT_SIZE*sizeof(float)); _inited = true; } FTprocPitch::~FTprocPitch() { if (!_inited) return; delete [] gLastPhase; delete [] gSumPhase; delete [] gAnaFreq; delete [] gSynFreq; delete [] gAnaMagn; delete [] gSynMagn; _filterlist.clear(); delete _filter; } void FTprocPitch::process (fft_data *data, unsigned int fftn) { if (!_inited || _filter->getBypassed()) { return; } float *filter = _filter->getValues(); double magn, phase, tmp, real, imag; double freqPerBin, expct; long k, qpd, index, stepSize; int fftFrameSize2 = fftn / 2; int fftFrameLength = fftn; float min = _filter->getMin(); float max = _filter->getMax(); float filt; int osamp = _oversamp; stepSize = fftFrameLength/osamp; freqPerBin = _sampleRate*2.0/(double)fftFrameLength; expct = 2.0*M_PI*(double)stepSize/(double)fftFrameLength; /* this is the analysis step */ for (k = 1; k < fftFrameSize2-1; k++) { real = data[k]; imag = data[fftFrameLength - k]; /* compute magnitude and phase */ magn = sqrt(real*real + imag*imag); phase = atan2(imag,real); /* compute phase difference */ tmp = phase - gLastPhase[k]; gLastPhase[k] = phase; /* subtract expected phase difference */ tmp -= (double)k*expct; /* map delta phase into +/- Pi interval */ qpd = (long) (tmp/M_PI); if (qpd >= 0) qpd += qpd&1; else qpd -= qpd&1; tmp -= M_PI*(double)qpd; /* get deviation from bin frequency from the +/- Pi interval */ tmp = osamp*tmp/(2.0f*M_PI); /* compute the k-th partials' true frequency */ tmp = (double)k*freqPerBin + tmp*freqPerBin; /* store magnitude and true frequency in analysis arrays */ gAnaMagn[k] = magn; gAnaFreq[k] = tmp; } /* ***************** PROCESSING ******************* */ /* this does the actual pitch scaling */ memset(gSynMagn, 0, fftFrameLength*sizeof(float)); memset(gSynFreq, 0, fftFrameLength*sizeof(float)); for (k = 0; k <= fftFrameSize2; k++) { filt = FTutils::f_clamp (filter[k], min, max); index = (long) (k/filt); if (index <= fftFrameSize2) { /* new bin overrides existing if magnitude is higher */ if (gAnaMagn[index] > gSynMagn[k]) { gSynMagn[k] = gAnaMagn[index]; gSynFreq[k] = gAnaFreq[index] * filt; } /* fill empty bins with nearest neighbour */ if ((gSynFreq[k] == 0.) && (k > 0)) { gSynFreq[k] = gSynFreq[k-1]; gSynMagn[k] = gSynMagn[k-1]; } } } /* ***************** SYNTHESIS ******************* */ /* this is the synthesis step */ for (k = 1; k < fftFrameSize2-1; k++) { /* get magnitude and true frequency from synthesis arrays */ magn = gSynMagn[k]; tmp = gSynFreq[k]; /* subtract bin mid frequency */ tmp -= (double)k*freqPerBin; /* get bin deviation from freq deviation */ tmp /= freqPerBin; /* take osamp into account */ tmp = 2.*M_PI*tmp/osamp; /* add the overlap phase advance back in */ tmp += (double)k*expct; /* accumulate delta phase to get bin phase */ gSumPhase[k] += tmp; phase = gSumPhase[k]; data[k] = magn*cos(phase); data[fftFrameLength - k] = magn*sin(phase); } } freqtweak-0.7.2/src/FTprocPitch.hpp0000644000175200017520000000246611226173741016176 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPROCPITCH_HPP__ #define __FTPROCPITCH_HPP__ #include "FTprocI.hpp" class FTprocPitch : public FTprocI { public: FTprocPitch (nframes_t samprate, unsigned int fftn); FTprocPitch (const FTprocPitch & other); virtual ~FTprocPitch(); FTprocI * clone() { return new FTprocPitch(*this); } void initialize(); void process (fft_data *data, unsigned int fftn); protected: FTspectrumModifier * _filter; // stuff for pitchscaling float *gLastPhase, *gSumPhase, *gAnaFreq, *gSynFreq, *gAnaMagn, *gSynMagn; }; #endif freqtweak-0.7.2/src/FTprocBoost.cpp0000644000175200017520000000367111226173741016207 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTprocBoost.hpp" #include "FTutils.hpp" FTprocBoost::FTprocBoost (nframes_t samprate, unsigned int fftn) : FTprocI("EQ Boost", samprate, fftn) { _confname = "Boost"; } FTprocBoost::FTprocBoost (const FTprocBoost & other) : FTprocI (other._name, other._sampleRate, other._fftN) { _confname = "Boost"; } void FTprocBoost::initialize() { // create filter _eqfilter = new FTspectrumModifier("EQ Boost", "freq_boost", 0, FTspectrumModifier::POS_GAIN_MODIFIER, BOOST_SPECMOD, _fftN/2, 1.0); _eqfilter->setRange(1.0, 16.0); _filterlist.push_back (_eqfilter); _inited = true; } FTprocBoost::~FTprocBoost() { if (!_inited) return; _filterlist.clear(); delete _eqfilter; } void FTprocBoost::process (fft_data *data, unsigned int fftn) { if (!_inited || _eqfilter->getBypassed()) { return; } float *filter = _eqfilter->getValues(); float min = _eqfilter->getMin(); float max = _eqfilter->getMax(); float filt; int fftN2 = (fftn+1) >> 1; filt = FTutils::f_clamp(filter[0], min, max); data[0] *= filt; for (int i = 1; i < fftN2-1; i++) { filt = FTutils::f_clamp(filter[i], min, max); data[i] *= filt; data[fftn-i] *= filt; } } freqtweak-0.7.2/src/FTprocBoost.hpp0000644000175200017520000000237711226173741016216 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPROCBOOST_HPP__ #define __FTPROCBOOST_HPP__ #include "FTprocI.hpp" class FTprocBoost : public FTprocI { public: FTprocBoost(nframes_t samprate, unsigned int fftn); FTprocBoost (const FTprocBoost & other); virtual ~FTprocBoost(); FTprocI * clone() { return new FTprocBoost(*this); } void initialize(); void process (fft_data *data, unsigned int fftn); virtual bool useAsDefault() { return false; } protected: FTspectrumModifier * _eqfilter; }; #endif freqtweak-0.7.2/src/FTmodulatorManager.cpp0000644000175200017520000000536111226173741017534 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTmodulatorManager.hpp" #include "FTioSupport.hpp" #include "FTmodulatorI.hpp" #include "FTmodRandomize.hpp" #include "FTmodRotate.hpp" #include "FTmodRotateLFO.hpp" #include "FTmodValueLFO.hpp" FTmodulatorManager * FTmodulatorManager::_instance = 0; FTmodulatorManager::FTmodulatorManager() { unsigned int fftn = 512; nframes_t samprate = FTioSupport::instance()->getSampleRate(); // TODO: load initial dynamically FTmodulatorI * procmod = new FTmodRotate (samprate, fftn); _prototypes.push_back (procmod); procmod = new FTmodRotateLFO (samprate, fftn); _prototypes.push_back (procmod); procmod = new FTmodValueLFO (samprate, fftn); _prototypes.push_back (procmod); procmod = new FTmodRandomize (samprate, fftn); _prototypes.push_back (procmod); } FTmodulatorManager::~FTmodulatorManager() { // cleanup prototypes for (ModuleList::iterator iter = _prototypes.begin(); iter != _prototypes.end(); ++iter) { delete (*iter); } _prototypes.clear(); } void FTmodulatorManager::getAvailableModules (ModuleList & outlist) { outlist.clear(); for (ModuleList::iterator iter = _prototypes.begin(); iter != _prototypes.end(); ++iter) { outlist.push_back(*iter); } } FTmodulatorI * FTmodulatorManager::getModuleByName (const string & name) { for (ModuleList::iterator iter = _prototypes.begin(); iter != _prototypes.end(); ++iter) { if ((*iter)->getName() == name) { return (*iter); } } return 0; } FTmodulatorI * FTmodulatorManager::getModuleByConfigName (const string & name) { for (ModuleList::iterator iter = _prototypes.begin(); iter != _prototypes.end(); ++iter) { if ((*iter)->getConfName() == name) { return (*iter); } } return 0; } FTmodulatorI * FTmodulatorManager::getModuleByIndex (unsigned int index) { if (index < _prototypes.size()) { unsigned int n=0; for (ModuleList::iterator iter = _prototypes.begin(); iter != _prototypes.end(); ++iter) { if (n == index) { return (*iter); } n++; } } return 0; } freqtweak-0.7.2/src/FTmodulatorManager.hpp0000644000175200017520000000277511226173741017547 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTMODULATORMANAGER_HPP__ #define __FTMODULATORMANAGER_HPP__ #include "FTtypes.hpp" #include #include using namespace std; class FTmodulatorI; class FTmodulatorManager { public: typedef list ModuleList; FTmodulatorManager(); virtual ~FTmodulatorManager(); static FTmodulatorManager * instance() { if (!_instance) _instance = new FTmodulatorManager(); return _instance; } void getAvailableModules (ModuleList & outlist); FTmodulatorI * getModuleByName (const string & name); FTmodulatorI * getModuleByConfigName (const string & name); FTmodulatorI * getModuleByIndex (unsigned int index); protected: ModuleList _prototypes; static FTmodulatorManager* _instance; }; #endif freqtweak-0.7.2/src/Makefile.am0000644000175200017520000000473311226173741015333 0ustar develdevel # Copyright (C) 2002 Jesse Chappell # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. COMMON_FLAGS = -Wall -D_REENTRANT \ @ARCH_CFLAGS@ #AM_CXXFLAGS = $(COMMON_FLAGS) $(EXTRA_CFLAGS) $(JACK_CFLAGS) $(FFTW_CFLAGS) @XML_CFLAGS@ #AM_CFLAGS = $(AM_CXXFLAGS) EXTRA_DIST = ftlogo.xpm $(wildcard pixmaps/*.xpm) #freqtweak_LDADD = @JACK_LIBS@ @XML_LIBS@ bin_PROGRAMS = freqtweak freqtweak_SOURCES = \ FTapp.cpp \ FTmainwin.cpp \ FTioSupport.cpp \ FTjackSupport.cpp \ FTprocessPath.cpp \ FTspectralEngine.cpp \ FTspectragram.cpp \ FTspectrumModifier.cpp \ FTactiveBarGraph.cpp \ FTutils.cpp \ FTportSelectionDialog.cpp\ FTconfigManager.cpp \ RingBuffer.cpp \ xml++.cpp \ xml++.hpp \ FTapp.hpp \ FTmainwin.hpp \ FTjackSupport.hpp \ FTioSupport.hpp \ FTprocessPath.hpp \ FTtypes.hpp \ FTspectralEngine.hpp \ FTspectragram.hpp \ FTspectrumModifier.hpp \ FTactiveBarGraph.hpp \ FTutils.hpp \ FTportSelectionDialog.hpp \ FTconfigManager.hpp \ FTupdateToken.hpp \ RingBuffer.hpp \ FTprocI.cpp \ FTprocI.hpp \ FTprocDelay.cpp \ FTprocDelay.hpp \ FTprocEQ.cpp \ FTprocEQ.hpp \ FTprocGate.cpp \ FTprocGate.hpp \ FTprocPitch.cpp \ FTprocPitch.hpp \ FTprocOrderDialog.cpp \ FTprocOrderDialog.hpp \ FTdspManager.cpp \ FTdspManager.hpp \ FTprocLimit.cpp \ FTprocLimit.hpp \ FTprocWarp.cpp \ FTprocWarp.hpp \ FTpresetBlendDialog.cpp \ FTpresetBlendDialog.hpp \ FTpresetBlender.cpp \ FTpresetBlender.hpp \ FTprocCompressor.cpp \ FTprocCompressor.hpp \ FTprocBoost.cpp \ FTprocBoost.hpp \ FThelpWindow.cpp \ FThelpWindow.hpp \ FTmodulatorI.cpp \ FTmodulatorI.hpp \ FTmodulatorManager.cpp \ FTmodulatorManager.hpp \ FTmodulatorDialog.cpp \ FTmodulatorDialog.hpp \ FTmodulatorGui.cpp \ FTmodulatorGui.hpp \ FTmodRandomize.cpp \ FTmodRandomize.hpp \ FTmodRotate.cpp \ FTmodRotate.hpp \ FTmodRotateLFO.cpp \ FTmodRotateLFO.hpp \ FTmodValueLFO.cpp \ FTmodValueLFO.hpp \ LockMonitor.hpp \ cycles.h \ pix_button.hpp \ pix_button.cpp \ slider_bar.hpp \ slider_bar.cpp \ spin_box.hpp \ spin_box.cpp \ pixmap_includes.hpp mac: freqtweak `@WX_CONFIG@ --rezflags` freqtweak freqtweak-0.7.2/src/Makefile.in0000644000175200017520000005176711226200760015345 0ustar develdevel# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2002 Jesse Chappell # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ ARCH_486_FALSE = @ARCH_486_FALSE@ ARCH_486_TRUE = @ARCH_486_TRUE@ ARCH_586_FALSE = @ARCH_586_FALSE@ ARCH_586_TRUE = @ARCH_586_TRUE@ ARCH_686_FALSE = @ARCH_686_FALSE@ ARCH_686_TRUE = @ARCH_686_TRUE@ ARCH_CFLAGS = @ARCH_CFLAGS@ ARCH_PPC_FALSE = @ARCH_PPC_FALSE@ ARCH_PPC_TRUE = @ARCH_PPC_TRUE@ ARCH_TYPE = @ARCH_TYPE@ ARCH_ULTRA_FALSE = @ARCH_ULTRA_FALSE@ ARCH_ULTRA_TRUE = @ARCH_ULTRA_TRUE@ ARCH_X86_FALSE = @ARCH_X86_FALSE@ ARCH_X86_TRUE = @ARCH_X86_TRUE@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFTW_CFLAGS = @FFTW_CFLAGS@ FFTW_LIBS = @FFTW_LIBS@ FREQTWEAK_MAJOR_VERSION = @FREQTWEAK_MAJOR_VERSION@ FREQTWEAK_MICRO_VERSION = @FREQTWEAK_MICRO_VERSION@ FREQTWEAK_MINOR_VERSION = @FREQTWEAK_MINOR_VERSION@ FREQTWEAK_VERSION = @FREQTWEAK_VERSION@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JACK_CFLAGS = @JACK_CFLAGS@ JACK_LIBS = @JACK_LIBS@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIGCPP_CFLAGS = @SIGCPP_CFLAGS@ SIGCPP_LIBS = @SIGCPP_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ WX_CONFIG = @WX_CONFIG@ WX_CONFIG0 = @WX_CONFIG0@ WX_CONFIG1 = @WX_CONFIG1@ WX_CONFIG2 = @WX_CONFIG2@ WX_CONFIG3 = @WX_CONFIG3@ WX_CONFIG4 = @WX_CONFIG4@ XML_CFLAGS = @XML_CFLAGS@ XML_LIBS = @XML_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ COMMON_FLAGS = -Wall -D_REENTRANT \ @ARCH_CFLAGS@ #AM_CXXFLAGS = $(COMMON_FLAGS) $(EXTRA_CFLAGS) $(JACK_CFLAGS) $(FFTW_CFLAGS) @XML_CFLAGS@ #AM_CFLAGS = $(AM_CXXFLAGS) EXTRA_DIST = ftlogo.xpm $(wildcard pixmaps/*.xpm) #freqtweak_LDADD = @JACK_LIBS@ @XML_LIBS@ bin_PROGRAMS = freqtweak freqtweak_SOURCES = \ FTapp.cpp \ FTmainwin.cpp \ FTioSupport.cpp \ FTjackSupport.cpp \ FTprocessPath.cpp \ FTspectralEngine.cpp \ FTspectragram.cpp \ FTspectrumModifier.cpp \ FTactiveBarGraph.cpp \ FTutils.cpp \ FTportSelectionDialog.cpp\ FTconfigManager.cpp \ RingBuffer.cpp \ xml++.cpp \ xml++.hpp \ FTapp.hpp \ FTmainwin.hpp \ FTjackSupport.hpp \ FTioSupport.hpp \ FTprocessPath.hpp \ FTtypes.hpp \ FTspectralEngine.hpp \ FTspectragram.hpp \ FTspectrumModifier.hpp \ FTactiveBarGraph.hpp \ FTutils.hpp \ FTportSelectionDialog.hpp \ FTconfigManager.hpp \ FTupdateToken.hpp \ RingBuffer.hpp \ FTprocI.cpp \ FTprocI.hpp \ FTprocDelay.cpp \ FTprocDelay.hpp \ FTprocEQ.cpp \ FTprocEQ.hpp \ FTprocGate.cpp \ FTprocGate.hpp \ FTprocPitch.cpp \ FTprocPitch.hpp \ FTprocOrderDialog.cpp \ FTprocOrderDialog.hpp \ FTdspManager.cpp \ FTdspManager.hpp \ FTprocLimit.cpp \ FTprocLimit.hpp \ FTprocWarp.cpp \ FTprocWarp.hpp \ FTpresetBlendDialog.cpp \ FTpresetBlendDialog.hpp \ FTpresetBlender.cpp \ FTpresetBlender.hpp \ FTprocCompressor.cpp \ FTprocCompressor.hpp \ FTprocBoost.cpp \ FTprocBoost.hpp \ FThelpWindow.cpp \ FThelpWindow.hpp \ FTmodulatorI.cpp \ FTmodulatorI.hpp \ FTmodulatorManager.cpp \ FTmodulatorManager.hpp \ FTmodulatorDialog.cpp \ FTmodulatorDialog.hpp \ FTmodulatorGui.cpp \ FTmodulatorGui.hpp \ FTmodRandomize.cpp \ FTmodRandomize.hpp \ FTmodRotate.cpp \ FTmodRotate.hpp \ FTmodRotateLFO.cpp \ FTmodRotateLFO.hpp \ FTmodValueLFO.cpp \ FTmodValueLFO.hpp \ LockMonitor.hpp \ cycles.h \ pix_button.hpp \ pix_button.cpp \ slider_bar.hpp \ slider_bar.cpp \ spin_box.hpp \ spin_box.cpp \ pixmap_includes.hpp subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = version.h bin_PROGRAMS = freqtweak$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_freqtweak_OBJECTS = FTapp.$(OBJEXT) FTmainwin.$(OBJEXT) \ FTioSupport.$(OBJEXT) FTjackSupport.$(OBJEXT) \ FTprocessPath.$(OBJEXT) FTspectralEngine.$(OBJEXT) \ FTspectragram.$(OBJEXT) FTspectrumModifier.$(OBJEXT) \ FTactiveBarGraph.$(OBJEXT) FTutils.$(OBJEXT) \ FTportSelectionDialog.$(OBJEXT) FTconfigManager.$(OBJEXT) \ RingBuffer.$(OBJEXT) xml++.$(OBJEXT) FTprocI.$(OBJEXT) \ FTprocDelay.$(OBJEXT) FTprocEQ.$(OBJEXT) FTprocGate.$(OBJEXT) \ FTprocPitch.$(OBJEXT) FTprocOrderDialog.$(OBJEXT) \ FTdspManager.$(OBJEXT) FTprocLimit.$(OBJEXT) \ FTprocWarp.$(OBJEXT) FTpresetBlendDialog.$(OBJEXT) \ FTpresetBlender.$(OBJEXT) FTprocCompressor.$(OBJEXT) \ FTprocBoost.$(OBJEXT) FThelpWindow.$(OBJEXT) \ FTmodulatorI.$(OBJEXT) FTmodulatorManager.$(OBJEXT) \ FTmodulatorDialog.$(OBJEXT) FTmodulatorGui.$(OBJEXT) \ FTmodRandomize.$(OBJEXT) FTmodRotate.$(OBJEXT) \ FTmodRotateLFO.$(OBJEXT) FTmodValueLFO.$(OBJEXT) \ pix_button.$(OBJEXT) slider_bar.$(OBJEXT) spin_box.$(OBJEXT) freqtweak_OBJECTS = $(am_freqtweak_OBJECTS) freqtweak_LDADD = $(LDADD) freqtweak_DEPENDENCIES = freqtweak_LDFLAGS = DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/FTactiveBarGraph.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTapp.Po ./$(DEPDIR)/FTconfigManager.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTdspManager.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FThelpWindow.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTioSupport.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTjackSupport.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTmainwin.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTmodRandomize.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTmodRotate.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTmodRotateLFO.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTmodValueLFO.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTmodulatorDialog.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTmodulatorGui.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTmodulatorI.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTmodulatorManager.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTportSelectionDialog.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTpresetBlendDialog.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTpresetBlender.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTprocBoost.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTprocCompressor.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTprocDelay.Po ./$(DEPDIR)/FTprocEQ.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTprocGate.Po ./$(DEPDIR)/FTprocI.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTprocLimit.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTprocOrderDialog.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTprocPitch.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTprocWarp.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTprocessPath.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTspectragram.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTspectralEngine.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTspectrumModifier.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/FTutils.Po ./$(DEPDIR)/RingBuffer.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/pix_button.Po ./$(DEPDIR)/slider_bar.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/spin_box.Po ./$(DEPDIR)/xml++.Po CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(freqtweak_SOURCES) DIST_COMMON = $(srcdir)/Makefile.in Makefile.am version.h.in SOURCES = $(freqtweak_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign src/Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) version.h: $(top_builddir)/config.status version.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) freqtweak$(EXEEXT): $(freqtweak_OBJECTS) $(freqtweak_DEPENDENCIES) @rm -f freqtweak$(EXEEXT) $(CXXLINK) $(freqtweak_LDFLAGS) $(freqtweak_OBJECTS) $(freqtweak_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTactiveBarGraph.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTapp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTconfigManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTdspManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FThelpWindow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTioSupport.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTjackSupport.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTmainwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTmodRandomize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTmodRotate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTmodRotateLFO.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTmodValueLFO.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTmodulatorDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTmodulatorGui.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTmodulatorI.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTmodulatorManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTportSelectionDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTpresetBlendDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTpresetBlender.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTprocBoost.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTprocCompressor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTprocDelay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTprocEQ.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTprocGate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTprocI.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTprocLimit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTprocOrderDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTprocPitch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTprocWarp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTprocessPath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTspectragram.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTspectralEngine.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTspectrumModifier.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FTutils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RingBuffer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pix_button.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slider_bar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spin_box.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml++.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCXX_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ @am__fastdepCXX_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ @am__fastdepCXX_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ @am__fastdepCXX_TRUE@ fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` uninstall-info-am: ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/pixmaps @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am info \ info-am install install-am install-binPROGRAMS install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-info-am mac: freqtweak `@WX_CONFIG@ --rezflags` freqtweak # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: freqtweak-0.7.2/src/FTportSelectionDialog.cpp0000644000175200017520000001064611226173741020207 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include #include "FTportSelectionDialog.hpp" #include "FTjackSupport.hpp" #define DESELECTALLID 3241 BEGIN_EVENT_TABLE(FTportSelectionDialog, wxDialog) EVT_BUTTON(wxID_OK, FTportSelectionDialog::OnOK) EVT_BUTTON(DESELECTALLID, FTportSelectionDialog::OnDeselectAll) END_EVENT_TABLE() FTportSelectionDialog::FTportSelectionDialog(wxWindow * parent, wxWindowID id, int pathIndex, PortType ptype, const wxString & title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxDialog(parent, id, title, pos, size, style, name) , _pathIndex(pathIndex), _portType(ptype) { init(); } void FTportSelectionDialog::init() { // FTjackSupport * iosup = FTjackSupport::instance(); wxBoxSizer * mainsizer = new wxBoxSizer(wxVERTICAL); _listBox = new wxListBox(this, wxNewId(), wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_MULTIPLE); wxButton * deselbutt = new wxButton(this, DESELECTALLID, wxT("Deselect All")); mainsizer->Add(deselbutt, 0, wxALL, 3); mainsizer->Add(_listBox, 1, wxALL|wxEXPAND, 3); // button bar wxBoxSizer * buttSizer = new wxBoxSizer(wxHORIZONTAL); wxButton *okButton = new wxButton(this, wxID_OK, wxT("OK")); wxButton *cancButton = new wxButton(this, wxID_CANCEL, wxT("Cancel")); buttSizer->Add(okButton, 0, wxRIGHT, 10); buttSizer->Add(cancButton, 0, wxLEFT, 10); mainsizer->Add(buttSizer, 0, wxALL|wxEXPAND, 4); SetAutoLayout( TRUE ); mainsizer->Fit( this ); mainsizer->SetSizeHints( this ); SetSizer( mainsizer ); } void FTportSelectionDialog::update() { // get ports from jack const char ** availports = 0; const char ** connports = 0; const char * noportname = 0; FTioSupport * iosup = FTioSupport::instance(); if (_portType == INPUT) { availports = iosup->getInputConnectablePorts(_pathIndex); connports = iosup->getConnectedInputPorts(_pathIndex); noportname = iosup->getOutputPortName(_pathIndex); } else if (_portType == OUTPUT) { availports = iosup->getOutputConnectablePorts(_pathIndex); connports = iosup->getConnectedOutputPorts(_pathIndex); noportname = iosup->getInputPortName(_pathIndex); } _listBox->Clear(); if (availports) { for (int i=0; availports[i]; i++) { if (noportname && wxString::FromAscii(availports[i]).Cmp(wxString::FromAscii (noportname)) != 0) { _listBox->Append (wxString::FromAscii(availports[i]), (void *) 0); } } free (availports); for (int i=0; i < _listBox->GetCount(); i++) { _listBox->Deselect(i); } if (connports) { for (int i=0; connports[i]; i++) { int n = _listBox->FindString(wxString::FromAscii (connports[i])); //printf ("connport = %s find is %d\n", connports[i], n); if (n >= 0) _listBox->SetSelection (n, TRUE); } free(connports); } } } const char ** FTportSelectionDialog::getSelectedPorts() { int n = _selectedPorts.GetCount(); const char ** pnames = (const char **) malloc(sizeof(char*) * n+1); for (int i=0; i < n; i++) { pnames[i] = wxString(_selectedPorts.Item(i)->GetData()).mb_str(); } pnames[n] = NULL; // must be deleted by them return pnames; } void FTportSelectionDialog::OnDeselectAll(wxCommandEvent &event) { for (int i=0; i < _listBox->GetCount(); i++) { _listBox->Deselect(i); } } void FTportSelectionDialog::OnOK(wxCommandEvent &event) { // get selection from listbox wxArrayInt selarr; int n = _listBox->GetSelections(selarr); _selectedPorts.Clear(); for (int i=0; i < n; i++) { _selectedPorts.Add(_listBox->GetString(selarr[i])); } if (IsModal()) { EndModal(wxID_OK); } else { SetReturnCode(wxID_OK); Show(0); } } freqtweak-0.7.2/src/FTportSelectionDialog.hpp0000644000175200017520000000333511226173741020211 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPOERTSELECTIONDIALOG_HPP__ #define __FTPOERTSELECTIONDIALOG_HPP__ #include class FTportSelectionDialog : public wxDialog { public: enum PortType { OUTPUT = 0, INPUT }; FTportSelectionDialog(wxWindow * parent, wxWindowID id, int pathIndex, PortType ptype, const wxString & title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(400,600), long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, const wxString& name = wxT("PortSelectionDialog")); const char ** getSelectedPorts(); void update(); protected: void init(); void OnOK(wxCommandEvent &event); void OnDeselectAll(wxCommandEvent &event); int _pathIndex; PortType _portType; wxListBox * _listBox; wxStringList _selectedPorts; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; #endif freqtweak-0.7.2/src/FTspectrumModifier.cpp0000644000175200017520000001223611226173741017553 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include #include #include #include using namespace std; #include "FTspectrumModifier.hpp" #include "FTtypes.hpp" FTspectrumModifier::FTspectrumModifier(const string &name, const string &configName, int group, FTspectrumModifier::ModifierType mtype, SpecModType smtype, int length, float initval) : _modType(mtype), _specmodType(smtype), _name(name), _configName(configName), _group(group), _values(0), _length(length), _linkedTo(0), _initval(initval), _id(0), _bypassed(false), _dirty(false), _extra_node(0) { _values = new float[FT_MAX_FFT_SIZE/2]; _tmpvalues = new float[FT_MAX_FFT_SIZE/2]; for (int i=0; i < FT_MAX_FFT_SIZE/2; i++) { _values[i] = initval; } } FTspectrumModifier::~FTspectrumModifier() { for (list::iterator iter = _listenerList.begin(); iter != _listenerList.end(); ++iter) { (*iter)->goingAway(this); } unlink(true); //printf ("delete specmod\n"); delete [] _values; delete [] _tmpvalues; } void FTspectrumModifier::registerListener (Listener * listener) { if ( find(_listenerList.begin(), _listenerList.end(), listener) == _listenerList.end()) { _listenerList.push_back (listener); } } void FTspectrumModifier::unregisterListener (Listener *listener) { _listenerList.remove (listener); } void FTspectrumModifier::setLength(int length) { int origlen = _length; if (length < FT_MAX_FFT_SIZE/2) { _length = length; // now resample existing values into new length if (! _linkedTo) { float scale = origlen / (float) length; for (int i=0; i < length; i++) { _tmpvalues[i] = _values[(int)(i*scale)]; } memcpy(_values, _tmpvalues, length * sizeof(float)); } } } bool FTspectrumModifier::link (FTspectrumModifier *specmod) { unlink(false); // do a cycle check FTspectrumModifier * spec = specmod; while (spec) { if (spec == this) { // cycle!!! bad!! return false; } spec = spec->getLink(); } _linkedTo = specmod; specmod->addedLinkFrom(this); return true; } void FTspectrumModifier::unlink (bool unlinksources) { if (_linkedTo) { _linkedTo->removedLinkFrom ( this ); // copy their values into our internal copy (_linkedTo); } _linkedTo = 0; if (unlinksources) { // now unlink all who are linked to me for (list::iterator node = _linkedFrom.begin(); node != _linkedFrom.end(); ) { FTspectrumModifier *specmod = (*node); specmod->unlink(false); node = _linkedFrom.begin(); } _linkedFrom.clear(); } } void FTspectrumModifier::addedLinkFrom (FTspectrumModifier * specmod) { // called from link() if ( find(_linkedFrom.begin(), _linkedFrom.end(), specmod) == _linkedFrom.end()) { _linkedFrom.push_back (specmod); } } void FTspectrumModifier::removedLinkFrom (FTspectrumModifier * specmod) { // called from unlink() _linkedFrom.remove (specmod); } bool FTspectrumModifier::isLinkedFrom (FTspectrumModifier *specmod) { list::iterator node = find (_linkedFrom.begin(), _linkedFrom.end(), specmod); return ( node != _linkedFrom.end()); } float * FTspectrumModifier::getValues() { if (_linkedTo) { return _linkedTo->getValues(); } return _values; } void FTspectrumModifier::reset() { float *data; if (getModifierType() == FREQ_MODIFIER) { float incr = (_max - _min) / _length; float val = _min; if (_linkedTo) { data = _linkedTo->getValues(); for (int i=0; i < _length; i++) { _values[i] = data[i] = val; val += incr; } } else { for (int i=0; i < _length; i++) { _values[i] = val; val += incr; } } } else { if (_linkedTo) { data = _linkedTo->getValues(); for (int i=0; i < _length; i++) { _values[i] = data[i] = _initval; } } else { for (int i=0; i < _length; i++) { _values[i] = _initval; } } } } void FTspectrumModifier::copy (FTspectrumModifier *specmod) { // this always copies into our internal values if (!specmod) return; float * othervals = specmod->getValues(); memcpy (_values, othervals, _length * sizeof(float)); } XMLNode * FTspectrumModifier::getExtraNode() { if (!_extra_node) { // create one _extra_node = new XMLNode("Extra"); } return _extra_node; } void FTspectrumModifier::setExtraNode (XMLNode * node) { if (!node) return; if (_extra_node) delete _extra_node; _extra_node = new XMLNode(*node); } freqtweak-0.7.2/src/FTspectrumModifier.hpp0000644000175200017520000000734711226173741017567 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTSPECTRUMMODIFIER_HPP__ #define __FTSPECTRUMMODIFIER_HPP__ #include "FTtypes.hpp" #include "xml++.hpp" #include #include using namespace std; class FTspectrumModifier { public: enum ModifierType { GAIN_MODIFIER = 0, TIME_MODIFIER, UNIFORM_MODIFIER, RATIO_MODIFIER, FREQ_MODIFIER, DB_MODIFIER, SEMITONE_MODIFIER, POS_GAIN_MODIFIER, // must be last! NULL_MODIFIER, }; class Listener { public: virtual ~Listener() {} virtual void goingAway(FTspectrumModifier * ft) = 0; }; FTspectrumModifier(const string & name, const string &configName, int group, ModifierType mtype, SpecModType smtype, int length=512, float initval=0.0); virtual ~FTspectrumModifier(); void setId (int id) { _id = id; } int getId () { return _id; } void setLength(int length); int getLength() { return _length; } string getName() { return _name; } void setName(const string & name) { _name = name; } string getConfigName() { return _configName; } void setConfigName(const string & name) { _configName = name; } int getGroup() { return _group; } void setGroup(int grp) { _group = grp; } float * getValues(); ModifierType getModifierType() { return _modType; } SpecModType getSpecModifierType() { return _specmodType; } FTspectrumModifier * getLink() { return _linkedTo; } bool link (FTspectrumModifier *specmod); void unlink (bool unlinksources=true); void setRange(float min, float max) { _min = min; _max = max; } void getRange(float &min, float &max) { min = _min; max = _max; } float getMin() const { return _min;} float getMax() const { return _max;} void setBypassed (bool flag) { _bypassed = flag; } bool getBypassed () { return _bypassed; } void setDirty (bool val) { _dirty = val; } // this is as close of a test-and-set as I need bool getDirty (bool tas=false, bool val=false) { if (_linkedTo) { return _linkedTo->getDirty(false); } if (_dirty) { if (tas) { _dirty = val; } return true; } return false; } // resets all bins to constructed value void reset(); void copy (FTspectrumModifier *specmod); list & getLinkedFrom() { return _linkedFrom; } bool isLinkedFrom (FTspectrumModifier *specmod); // user notification void registerListener (Listener * listener); void unregisterListener (Listener *listener); XMLNode * getExtraNode(); void setExtraNode(XMLNode * node); protected: void addedLinkFrom (FTspectrumModifier * specmod); void removedLinkFrom (FTspectrumModifier * specmod); ModifierType _modType; SpecModType _specmodType; string _name; string _configName; int _group; // might point to a linked value array float * _values; float * _tmpvalues; // used for copying int _length; FTspectrumModifier *_linkedTo; float _min, _max; float _initval; list _linkedFrom; int _id; bool _bypassed; bool _dirty; list _listenerList; XMLNode * _extra_node; }; #endif freqtweak-0.7.2/src/FTprocCompressor.cpp0000644000175200017520000001766611226200457017261 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTprocCompressor.hpp" #include "FTutils.hpp" #include #include using namespace std; #include /** * the following taken from SWH plugins utility functions * we'll wrap it up later */ #define A_TBL 256 static inline float rms_env_process(rms_env *r, float x); inline static float rms_env_process(rms_env *r, const float x) { r->sum -= r->buffer[r->pos]; r->sum += x; r->buffer[r->pos] = x; r->pos = (r->pos + 1) & (RMS_BUF_SIZE - 1); return FTutils::fast_square_root(r->sum / (float)RMS_BUF_SIZE); } static void rms_env_reset(rms_env *r) { unsigned int i; for (i=0; ibuffer[i] = 0.0f; } r->pos = 0; r->sum = 0.0f; } static rms_env *rms_env_new() { rms_env *nenv = new rms_env; rms_env_reset(nenv); return nenv; } static void rms_env_free(rms_env *r) { delete r; } static inline int f_round(float f) { f += (3<<22); return *((int*)&f) - 0x4b400000; } FTprocCompressor::FTprocCompressor (nframes_t samprate, unsigned int fftn) : FTprocI("Compressor", samprate, fftn) , _dbAdjust(12.0) { _confname = "Compressor"; } FTprocCompressor::FTprocCompressor (const FTprocCompressor & other) : FTprocI (other._name, other._sampleRate, other._fftN) , _dbAdjust(12.0) { _confname = "Compressor"; } void FTprocCompressor::initialize() { // create filter _thresh_filter = new FTspectrumModifier("Comp Thresh", "compressor_thresh", 0, FTspectrumModifier::DB_MODIFIER, COMPRESS_SPECMOD, _fftN/2, 0.0); _thresh_filter->setRange(-60.0, 0.0); _filterlist.push_back (_thresh_filter); _ratio_filter = new FTspectrumModifier("Comp Ratio", "compressor_ratio", 1, FTspectrumModifier::RATIO_MODIFIER, COMPRESS_SPECMOD, _fftN/2, 1.0); _ratio_filter->setRange(1.0, 20.0); _filterlist.push_back (_ratio_filter); _release_filter = new FTspectrumModifier("Comp A/R", "compressor_release", 2, FTspectrumModifier::TIME_MODIFIER, COMPRESS_SPECMOD, _fftN/2, 0.2); _release_filter->setRange(0.0, 1.0); _filterlist.push_back (_release_filter); _attack_filter = new FTspectrumModifier("Comp A/R", "compressor_attack", 2, FTspectrumModifier::TIME_MODIFIER, COMPRESS_SPECMOD, _fftN/2, 0.1); _attack_filter->setRange(0.0, 1.0); _filterlist.push_back (_attack_filter); _makeup_filter = new FTspectrumModifier("Comp Makeup", "compressor_makeup", 3, FTspectrumModifier::DB_MODIFIER, COMPRESS_SPECMOD, _fftN/2, 0.0); _makeup_filter->setRange(0.0, 32.0); _filterlist.push_back (_makeup_filter); // state unsigned int nbins = _fftN >> 1; _rms = new rms_env*[nbins]; _sum = new float[nbins]; _amp = new float[nbins]; _gain = new float[nbins]; _gain_t = new float[nbins]; _env = new float[nbins]; _count = new unsigned int[nbins]; for (unsigned int n=0; n < nbins; ++n) { _rms[n] = rms_env_new(); } memset(_sum, 0, nbins * sizeof(float)); memset(_amp, 0, nbins * sizeof(float)); memset(_gain, 0, nbins * sizeof(float)); memset(_gain_t, 0, nbins * sizeof(float)); memset(_env, 0, nbins * sizeof(float)); memset(_count, 0, nbins * sizeof(unsigned int)); _as = new float[A_TBL]; _as[0] = 1.0f; for (unsigned int i=1; i> 1; FTprocI::setFFTsize(fftn); // reallocate all state arrays for (unsigned int n=0; n < orignbins; ++n) { rms_env_free(_rms[n]); } delete [] _rms; delete [] _sum; delete [] _amp; delete [] _gain; delete [] _gain_t; delete [] _env; delete [] _count; unsigned int nbins = _fftN >> 1; _rms = new rms_env*[nbins]; _sum = new float[nbins]; _amp = new float[nbins]; _gain = new float[nbins]; _gain_t = new float[nbins]; _env = new float[nbins]; _count = new unsigned int [nbins]; for (unsigned int n=0; n < nbins; ++n) { _rms[n] = rms_env_new(); } memset(_sum, 0, nbins * sizeof(float)); memset(_amp, 0, nbins * sizeof(float)); memset(_gain, 0, nbins * sizeof(float)); memset(_gain_t, 0, nbins * sizeof(float)); memset(_env, 0, nbins * sizeof(float)); memset(_count, 0, nbins * sizeof(unsigned int)); _as[0] = 1.0f; for (unsigned int i=1; igetBypassed()) { return; } float *threshold = _thresh_filter->getValues(); float *ratio = _ratio_filter->getValues(); float *attack = _attack_filter->getValues(); float *release = _release_filter->getValues(); float *makeup = _makeup_filter->getValues(); const float knee = 5.0; float ga; float gr; float rs; float mug; float knee_min; float knee_max; float ef_a; float ef_ai; float thresh; float rat; float att, rel; int fftN2 = (fftn+1) >> 1; for (int i = 0; i < fftN2-1; i++) { // if (filter[i] > max) filt = max; // else if (filter[i] < min) filt = min; // else filt = filter[i]; // power = (data[i] * data[i]) + (data[fftn-i] * data[fftn-i]); // db = FTutils::powerLogScale (power, 0.0000000) + _dbAdjust; // total fudge factors thresh = LIMIT(threshold[i], -60.0f, 0.0f) + _dbAdjust; rat = LIMIT(ratio[i], 1.0f, 80.0f); att = LIMIT(attack[i], 0.002f, 1.0f); rel = LIMIT(release[i], att, 1.0f); ga = _as[f_round(att * (float)(A_TBL-1))]; gr = _as[f_round(rel * (float)(A_TBL-1))]; rs = (rat - 1.0f) / rat; mug = db2lin(LIMIT(makeup[i], 0.0f, 32.0f)); knee_min = db2lin(thresh - knee); knee_max = db2lin(thresh + knee); ef_a = ga * 0.25f; ef_ai = 1.0f - ef_a; //_sum[i] += FTutils::fast_square_root((data[i] * data[i]) + (data[fftn-i] * data[fftn-i])); if (i == 0) { _sum[i] += (data[i] * data[i]); } else { _sum[i] += (data[i] * data[i]) + (data[fftn-i] * data[fftn-i]); } // _sum[i] = FLUSH_TO_ZERO(_sum[i]); // _env[i] = FLUSH_TO_ZERO(_env[i]); // _amp[i] = FLUSH_TO_ZERO(_amp[i]); // _rms[i]->sum = FLUSH_TO_ZERO(_rms[i]->sum); // _gain[i] = FLUSH_TO_ZERO(_gain[i]); if (_amp[i] > _env[i]) { _env[i] = _env[i] * ga + _amp[i] * (1.0f - ga); } else { _env[i] = _env[i] * gr + _amp[i] * (1.0f - gr); } if (_count[i]++ % 4 == 3) { _amp[i] = rms_env_process(_rms[i], _sum[i] * 0.25f); _sum[i] = 0.0f; if (_env[i] <= knee_min) { _gain_t[i] = 1.0f; } else if (_env[i] < knee_max) { const float x = -(thresh - knee - lin2db(_env[i])) / knee; _gain_t[i] = db2lin(-knee * rs * x * x * 0.25f); } else { _gain_t[i] = db2lin((thresh - lin2db(_env[i])) * rs); } } _gain[i] = _gain[i] * ef_a + _gain_t[i] * ef_ai; data[i] *= _gain[i] * mug; if (i > 0) { data[fftn-i] *= _gain[i] * mug; } } } freqtweak-0.7.2/src/FTprocCompressor.hpp0000644000175200017520000000457111226173741017262 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPROCCOMPRESSOR_HPP__ #define __FTPROCCOMPRESSOR_HPP__ #include "FTprocI.hpp" #include "FTutils.hpp" #include #define RMS_BUF_SIZE 64 typedef struct { float buffer[RMS_BUF_SIZE]; unsigned int pos; float sum; } rms_env; class FTprocCompressor : public FTprocI { public: FTprocCompressor(nframes_t samprate, unsigned int fftn); FTprocCompressor (const FTprocCompressor & other); virtual ~FTprocCompressor(); FTprocI * clone() { return new FTprocCompressor(*this); } void initialize(); void process (fft_data *data, unsigned int fftn); virtual void setFFTsize (unsigned int fftn); virtual void setOversamp (int osamp); virtual bool useAsDefault() { return false; } inline float db2lin(float db); inline float lin2db(float pow); protected: FTspectrumModifier * _thresh_filter; FTspectrumModifier * _ratio_filter; FTspectrumModifier * _attack_filter; FTspectrumModifier * _release_filter; FTspectrumModifier * _makeup_filter; // state float * _sum; float * _amp; float * _gain; float * _gain_t; float * _env; unsigned int * _count; float * _as; rms_env ** _rms; float _dbAdjust; }; inline float FTprocCompressor::db2lin(float db) { //float nval = (20.0 * FTutils::fast_log10(yval / refmax)); float nval = ::pow ( (float)10.0, db/20); // printf ("scaled value is %g mincut=%g\n", nval, _minCutoff); return nval; } inline float FTprocCompressor::lin2db(float power) { //float db = FTutils::powerLogScale (power, 0.0000000) + _dbAdjust; // total fudge factors float db = FTutils::powerLogScale (power, 0.0000000); return db; } #endif freqtweak-0.7.2/src/FTapp.cpp0000644000175200017520000002356611226173741015022 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include #include #include #include //#include // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" // for all others, include the necessary headers (this file is usually all you // need because it includes almost all "standard" wxWindows headers #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include #include "version.h" #include "FTapp.hpp" #include "FTtypes.hpp" #include "FTmainwin.hpp" #include "FTioSupport.hpp" #include "FTprocessPath.hpp" // Create a new application object: this macro will allow wxWindows to create // the application object during program execution (it's better than using a // static object for many reasons) and also declares the accessor function // wxGetApp() which will return the reference of the right type (i.e. MyApp and // not wxApp) IMPLEMENT_APP(FTapp) // ============================================================================ // implementation // ============================================================================ // ---------------------------------------------------------------------------- // the application class // ---------------------------------------------------------------------------- static const wxCmdLineEntryDesc cmdLineDesc[] = { { wxCMD_LINE_SWITCH, wxT("h"), wxT("help"), wxT("show this help"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP }, { wxCMD_LINE_OPTION, wxT("c"), wxT("channels"), wxT("# processing channels (1-4) default is 2"), wxCMD_LINE_VAL_NUMBER }, { wxCMD_LINE_OPTION, wxT("i"), wxT("inputs"), wxT("connect inputs from these jack ports (separate each channel with commas).\n") "\t\t\tDefaults to 'alsa_pcm:capture_1,..." }, { wxCMD_LINE_OPTION, wxT("o"), wxT("outputs"), wxT("connect outputs to these jack ports (separate each channel with commas).\n") "\t\t\tDefaults to 'alsa_pcm:playback_1,...'" }, { wxCMD_LINE_OPTION, wxT("n"), wxT("jack-name"), wxT("jack name. default is freqtweak_1")}, { wxCMD_LINE_OPTION, wxT("S"), wxT("jack-server"), wxT("jack server name")}, { wxCMD_LINE_OPTION, wxT("p"), wxT("preset"), wxT("load given preset initially")}, { wxCMD_LINE_OPTION, wxT("r"), wxT("rc-dir"), wxT("what directory to use for run-control state. default is ~/.freqtweak")}, { wxCMD_LINE_NONE } }; FTapp::FTapp() : _mainwin(0) { } static void* watchdog_thread(void* arg) { sigset_t signalset; //struct ecasound_state* state = reinterpret_cast(arg); int signalno; bool exiting = false; /* register cleanup routine */ //atexit(&ecasound_atexit_cleanup); // cerr << "Watchdog-thread created, pid=" << getpid() << "." << endl; while (!exiting) { sigemptyset(&signalset); /* handle the following signals explicitly */ sigaddset(&signalset, SIGTERM); sigaddset(&signalset, SIGINT); sigaddset(&signalset, SIGHUP); sigaddset(&signalset, SIGPIPE); /* block until a signal received */ sigwait(&signalset, &signalno); //cerr << endl << "freqtweak: watchdog-thread received signal " << signalno << ". Cleaning up..." << endl; if (signalno == SIGHUP) { // reinit iosupport // cerr << "freqtweak got SIGHUP... reiniting" << endl; // wxThread::Sleep(200); // FTioSupport * iosup = FTioSupport::instance(); // if (!iosup->isInited()) { // iosup->init(); // if (iosup->startProcessing()) { // iosup->reinit(); // } // } // if (::wxGetApp().getMainwin()) { // ::wxGetApp().getMainwin()->updateDisplay(); // } exiting = true; } else { exiting = true; } } ::wxGetApp().getMainwin()->Close(TRUE); ::wxGetApp().ExitMainLoop(); printf ("bye bye, hope you had fun...\n"); /* to keep the compilers happy; never actually executed */ return(0); } /** * Sets up a signal mask with sigaction() that blocks * all common signals, and then launces an watchdog * thread that waits on the blocked signals using * sigwait(). */ void FTapp::setupSignals() { pthread_t watchdog; /* man pthread_sigmask: * "...signal actions and signal handlers, as set with * sigaction(2), are shared between all threads" */ struct sigaction blockaction; blockaction.sa_handler = SIG_IGN; sigemptyset(&blockaction.sa_mask); blockaction.sa_flags = 0; /* ignore the following signals */ sigaction(SIGTERM, &blockaction, 0); sigaction(SIGINT, &blockaction, 0); sigaction(SIGHUP, &blockaction, 0); sigaction(SIGPIPE, &blockaction, 0); int res = pthread_create(&watchdog, NULL, watchdog_thread, NULL); if (res != 0) { cerr << "freqtweak: Warning! Unable to create watchdog thread." << endl; } } // `Main program' equivalent: the program execution "starts" here bool FTapp::OnInit() { // signal (SIGTERM, onTerminate); // signal (SIGINT, onTerminate); // signal (SIGHUP, onHangup); wxString inputports[FT_MAXPATHS]; wxString outputports[FT_MAXPATHS]; wxString jackname; wxString preset; wxString rcdir; wxString jackdir; int pcnt = 2; int icnt = 0; int ocnt = 0; bool connected = true; SetExitOnFrameDelete(TRUE); setupSignals(); if (sizeof(sample_t) != sizeof(float)) { fprintf(stderr, "FFTW Mismatch! You need to build FreqTweak against a single-precision\n"); fprintf(stderr, " FFTW library. See the INSTALL file for instructions.\n"); return FALSE; } // use stderr as log wxLog *logger=new wxLogStderr(); logger->SetTimestamp(NULL); wxLog::SetActiveTarget(logger); wxCmdLineParser parser(argc, argv); parser.SetDesc(cmdLineDesc); parser.SetLogo(wxT("FreqTweak ") + wxString::FromAscii (freqtweak_version) + wxT("\nCopyright 2002-2004 Jesse Chappell\n") wxT("FreqTweak comes with ABSOLUTELY NO WARRANTY\n") wxT("This is free software, and you are welcome to redistribute it\n") wxT("under certain conditions; see the file COPYING for details\n")); int ret = parser.Parse(); if (ret != 0) { // help or error return FALSE; } wxString strval; long longval; if (parser.Found (wxT("c"), &longval)) { if (longval < 1 || longval > FT_MAXPATHS) { fprintf(stderr, "Error: channel count must be in range [1-%d]\n", FT_MAXPATHS); parser.Usage(); return FALSE; } pcnt = (int) longval; } if (parser.Found (wxT("S"), &jackdir)) { FTioSupport::setDefaultServer ((const char *) jackdir.ToAscii()); } if (parser.Found (wxT("n"), &jackname)) { // FIXME: needs wchar_t->char conversion FTioSupport::setDefaultName ((const char *)jackname.ToAscii()); } parser.Found (wxT("r"), &rcdir); parser.Found (wxT("p"), &preset); // initialize jack support FTioSupport * iosup = FTioSupport::instance(); if (!iosup->init()) { fprintf(stderr, "Error connecting to jack!\n"); return FALSE; } if (parser.Found (wxT("i"), &strval)) { // parse comma separated values wxString port = strval.BeforeFirst(','); wxString remain = strval.AfterFirst(','); int id=0; while (!port.IsEmpty() && id < pcnt) { inputports[id++] = port; port = remain.BeforeFirst(','); remain = remain.AfterFirst(','); ++icnt; } } else { // Do not use default input ports anymore icnt = 0; // const char ** ports = iosup->getPhysicalInputPorts(); // if (ports) { // // default input ports // for (int id=0; id < pcnt && ports[id]; ++id, ++icnt) { // inputports[id] = ports[id]; // } // free (ports); // } } // OUTPUT PORTS if (parser.Found (wxT("o"), &strval)) { // parse comma separated values wxString port = strval.BeforeFirst(','); wxString remain = strval.AfterFirst(','); int id=0; while (!port.IsEmpty() && id < pcnt) { outputports[id++] = port; port = remain.BeforeFirst(','); remain = remain.AfterFirst(','); ++ocnt; } } else { const char ** ports = iosup->getPhysicalOutputPorts(); if (ports) { // default output ports for (int id=0; id < pcnt && ports[id]; ++id, ++ocnt) { // FIXME: needs wchar_t->char conversion outputports[id] = wxString::FromAscii (ports[id]); } free (ports); } } // Create the main application window _mainwin = new FTmainwin(pcnt, wxT("FreqTweak"), rcdir, wxPoint(100, 100), wxDefaultSize); // Show it and tell the application that it's our main window _mainwin->SetSize(669,770); _mainwin->Show(TRUE); SetTopWindow(_mainwin); if (connected) { // only start processing after building mainwin and connected // to JACK iosup->startProcessing(); if ( preset.IsEmpty()) { // connect initial I/O for (int id=0; id < icnt; ++id) { iosup->connectPathInput(id, (const char *) inputports[id].ToAscii()); } for (int id=0; id < ocnt; ++id) { iosup->connectPathOutput(id, (const char *) outputports[id].ToAscii()); } // load last settings _mainwin->loadPreset(wxT(""), true); } else { _mainwin->loadPreset(preset); } } _mainwin->updateDisplay(); // success: wxApp::OnRun() will be called which will enter the main message // loop and the application will run. If we returned FALSE here, the // application would exit immediately. return TRUE; } freqtweak-0.7.2/src/FTapp.hpp0000644000175200017520000000270711226173741015021 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPAPPHPP__ #define __FTPAPPHPP__ #include #include "FTtypes.hpp" class FTmainwin; class FTprocessPath; class FTapp : public wxApp { public: // override base class virtuals // ---------------------------- FTapp(); // this one is called on application startup and is a good place for the app // initialization (doing it here and not in the ctor allows to have an error // return: if OnInit() returns false, the application terminates) virtual bool OnInit(); FTmainwin * getMainwin() { return _mainwin; } //FTprocessPath * getProcessPath(int index); void setupSignals(); protected: FTmainwin * _mainwin; }; DECLARE_APP(FTapp); #endif freqtweak-0.7.2/src/FTprocWarp.cpp0000644000175200017520000000455711226200417016025 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTprocWarp.hpp" #include "FTutils.hpp" #include FTprocWarp::FTprocWarp (nframes_t samprate, unsigned int fftn) : FTprocI("Warp", samprate, fftn) { _confname = "Warp"; } FTprocWarp::FTprocWarp (const FTprocWarp & other) : FTprocI (other._name, other._sampleRate, other._fftN) { _confname = "Warp"; } void FTprocWarp::initialize() { // create filter _filter = new FTspectrumModifier("Warp", "warp", 0, FTspectrumModifier::FREQ_MODIFIER, WARP_SPECMOD, _fftN/2, 0.0); _filter->setRange(0.0, _fftN/2.0); _filter->reset(); _filterlist.push_back (_filter); _tmpdata = new fft_data[FT_MAX_FFT_SIZE]; _inited = true; } FTprocWarp::~FTprocWarp() { if (!_inited) return; _filterlist.clear(); delete _filter; delete [] _tmpdata; } void FTprocWarp::process (fft_data *data, unsigned int fftn) { if (!_inited || _filter->getBypassed()) { return; } float *filter = _filter->getValues(); float min = _filter->getMin(); float max = _filter->getMax(); float filt; int fftN2 = (fftn+1) >> 1; memset(_tmpdata, 0, fftn * sizeof(fft_data)); for (int i = 1; i < fftN2-1; i++) { filt = FTutils::f_clamp(filter[i], min, max); // _tmpdata[i] += data[(int)filt]; // _tmpdata[fftn-i] += data[fftn - ((int)filt)]; _tmpdata[(int)filt] += data[i]; if (i > 0 && filt > 0) { _tmpdata[fftn-((int)filt)] += data[fftn - i]; } } memcpy (data, _tmpdata, fftn * sizeof(fft_data)); } void FTprocWarp::setFFTsize (unsigned int fftn) { FTprocI::setFFTsize (fftn); // reset our filters max _filter->setRange (0.0, (float) (fftn >> 1)); _filter->reset(); } freqtweak-0.7.2/src/FTprocWarp.hpp0000644000175200017520000000246211226173741016034 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPROCWARP_HPP__ #define __FTPROCWARP_HPP__ #include "FTprocI.hpp" class FTprocWarp : public FTprocI { public: FTprocWarp(nframes_t samprate, unsigned int fftn); FTprocWarp (const FTprocWarp & other); virtual ~FTprocWarp(); FTprocI * clone() { return new FTprocWarp(*this); } void initialize(); void process (fft_data *data, unsigned int fftn); void setFFTsize (unsigned int fftn); virtual bool useAsDefault() { return false; } protected: FTspectrumModifier * _filter; fft_data *_tmpdata; }; #endif freqtweak-0.7.2/src/spin_box.cpp0000644000175200017520000003522011226173741015617 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include #include #include #include "spin_box.hpp" using namespace JLCui; using namespace std; // Convert a value in dB's to a coefficent #define DB_CO(g) ((g) > -144.0 ? pow(10.0, (g) * 0.05) : 0.0) #define CO_DB(v) (20.0 * log10(v)) static inline double gain_to_slider_position (double g) { if (g == 0) return 0; //return pow((6.0*log(g)/log(2.0)+192.0)/198.0, 8.0); return pow((6.0*log(g)/log(2.0)+198.0)/198.0, 8.0); } static inline double slider_position_to_gain (double pos) { if (pos == 0) { return 0.0; } /* XXX Marcus writes: this doesn't seem right to me. but i don't have a better answer ... */ //return pow (2.0,(sqrt(sqrt(sqrt(pos)))*198.0-192.0)/6.0); return pow (2.0,(sqrt(sqrt(sqrt(pos)))*198.0-198.0)/6.0); } enum { ID_TextCtrl = 8000, ID_EditMenuOp, ID_DefaultMenuOp, ID_BindMenuOp, ID_UpdateTimer }; BEGIN_EVENT_TABLE(SpinBox, wxWindow) EVT_SIZE(SpinBox::OnSize) EVT_PAINT(SpinBox::OnPaint) EVT_MOUSE_EVENTS(SpinBox::OnMouseEvents) EVT_MOUSEWHEEL (SpinBox::OnMouseEvents) //EVT_TEXT (ID_TextCtrl, SpinBox::on_text_event) EVT_TEXT_ENTER (ID_TextCtrl, SpinBox::on_text_event) EVT_MENU (ID_EditMenuOp , SpinBox::on_menu_events) EVT_MENU (ID_DefaultMenuOp , SpinBox::on_menu_events) EVT_MENU (ID_BindMenuOp , SpinBox::on_menu_events) EVT_TIMER (ID_UpdateTimer, SpinBox::on_update_timer) EVT_KILL_FOCUS (SpinBox::OnFocusEvent) END_EVENT_TABLE() SpinBox::SpinBox(wxWindow * parent, wxWindowID id, float lb, float ub, float val, bool midibindable, const wxPoint& pos, const wxSize& size) : wxWindow(parent, id, pos, size) { _lower_bound = lb; _upper_bound = ub; _default_val = _value = val; _backing_store = 0; _dragging = false; _decimal_digits = 1; _text_ctrl = 0; _ignoretext = false; _oob_flag = false; _showval_flag = true; _increment = 1.0f; _direction = 0.0f; _bgcolor.Set(30,30,30); _bgbrush.SetColour (_bgcolor); SetBackgroundColour (_bgcolor); SetThemeEnabled(false); _valuecolor.Set(244, 255, 178); _textcolor = *wxWHITE; _barcolor.Set(14, 50, 100); _overbarcolor.Set(20, 50, 80); _barbrush.SetColour(_bgcolor); //_bgbordercolor.Set(30,30,30); _bordercolor.Set(67, 83, 103); _borderpen.SetColour(_bordercolor); _borderpen.SetWidth(1); _borderbrush.SetColour(_bgcolor); _linebrush.SetColour(wxColour(154, 245, 168)); _scale_mode = LinearMode; _snap_mode = NoSnap; _popup_menu = new wxMenu(wxT("")); _popup_menu->Append ( new wxMenuItem(_popup_menu, ID_EditMenuOp, wxT("Edit"))); _popup_menu->Append ( new wxMenuItem(_popup_menu, ID_DefaultMenuOp, wxT("Set to default"))); if (midibindable) { _popup_menu->AppendSeparator(); _popup_menu->Append ( new wxMenuItem(_popup_menu, ID_BindMenuOp, wxT("Learn MIDI Binding"))); } _update_timer = new wxTimer(this, ID_UpdateTimer); update_size(); } SpinBox::~SpinBox() { _memdc.SelectObject(wxNullBitmap); if (_backing_store) { delete _backing_store; } } bool SpinBox::SetFont(const wxFont & fnt) { bool ret = wxWindow::SetFont(fnt); _memdc.SetFont(fnt); return ret; } void SpinBox::set_snap_mode (SnapMode md) { if (md != _snap_mode) { _snap_mode = md; } } void SpinBox::set_scale_mode (ScaleMode mode) { if (mode != _scale_mode) { _scale_mode = mode; update_value_str(); Refresh(false); } } void SpinBox::set_bounds (float lb, float ub) { if (_lower_bound != lb || _upper_bound != ub) { _lower_bound = lb; _upper_bound = ub; // force value to within if (_value < _lower_bound) { _value = _lower_bound; update_value_str(); Refresh(false); } else if (_value > _upper_bound) { _value = _upper_bound; update_value_str(); Refresh(false); } } } void SpinBox::set_label (const wxString & label) { _label_str = label; Refresh(false); } void SpinBox::set_units (const wxString & units) { _units_str = units; update_value_str(); Refresh(false); } void SpinBox::set_decimal_digits (int val) { _decimal_digits = val; update_value_str(); Refresh(false); } void SpinBox::set_value (float val) { float newval = val; if (_scale_mode == ZeroGainMode) { newval = gain_to_slider_position (val); } // if (_snap_mode == IntegerSnap) { // newval = nearbyintf (newval); // } if (!_oob_flag) { newval = min (newval, _upper_bound); newval = max (newval, _lower_bound); } if (newval != _value) { _value = newval; update_value_str(); Refresh(false); } } float SpinBox::get_value () { if (_scale_mode == ZeroGainMode) { return slider_position_to_gain(_value); } else { return _value; } } void SpinBox::update_value_str() { if (_scale_mode == ZeroGainMode) { float gain = slider_position_to_gain(_value); if (gain == 0) { _value_str.Printf(wxT("-inf %s"), _units_str.c_str()); } else { _value_str.Printf(wxT("%.*f %s"), _decimal_digits, CO_DB(gain), _units_str.c_str()); } } else { _value_str.Printf(wxT("%.*f %s"), _decimal_digits, _value, _units_str.c_str()); } } wxString SpinBox::get_precise_value_str() { wxString valstr; if (_scale_mode == ZeroGainMode) { float gain = slider_position_to_gain(_value); if (gain == 0) { valstr.Printf(wxT("-inf")); } else if (_snap_mode == IntegerSnap) { valstr.Printf(wxT("%g"), CO_DB(gain)); } else { valstr.Printf(wxT("%.8f"), CO_DB(gain)); } } else { if (_snap_mode == IntegerSnap) { valstr.Printf(wxT("%g"), _value); } else { valstr.Printf(wxT("%.8f"), _value); } } return valstr; } void SpinBox::set_bg_color (const wxColour & col) { _bgcolor = col; _bgbrush.SetColour (col); SetBackgroundColour (col); Refresh(false); } void SpinBox::set_text_color (const wxColour & col) { _textcolor = col; Refresh(false); } void SpinBox::set_border_color (const wxColour & col) { _bordercolor = col; _borderbrush.SetColour (col); Refresh(false); } void SpinBox::set_bar_color (const wxColour & col) { _barcolor = col; _barbrush.SetColour (col); Refresh(false); } void SpinBox::update_size() { GetClientSize(&_width, &_height); if (_width > 0 && _height > 0) { _val_scale = (_upper_bound - _lower_bound) / (_width); _memdc.SelectObject (wxNullBitmap); if (_backing_store) { delete _backing_store; } _backing_store = new wxBitmap(_width, _height); _memdc.SelectObject(*_backing_store); _memdc.SetFont(GetFont()); _border_shape[0].x = 0; _border_shape[0].y = _height-3; _border_shape[1].x = 0; _border_shape[1].y = 2; _border_shape[2].x = 2; _border_shape[2].y = 0; _border_shape[3].x = _width - 3; _border_shape[3].y = 0; _border_shape[4].x = _width -1; _border_shape[4].y = 2; _border_shape[5].x = _width -1; _border_shape[5].y = _height - 3; _border_shape[6].x = _width -3; _border_shape[6].y = _height - 1; _border_shape[7].x = 2; _border_shape[7].y = _height - 1; update_bar_shape(); } } void SpinBox::update_bar_shape() { if (_direction < 0) { _bar_shape[0].x = 1; _bar_shape[0].y = 1; _bar_shape[1].x = _width/2 - 1; _bar_shape[1].y = 1; _bar_shape[2].x = _width/2 - _height/2; _bar_shape[2].y = _height/2; _bar_shape[3].x = _width/2 - 1; _bar_shape[3].y = _height - 1; _bar_shape[4].x = 1; _bar_shape[4].y = _height - 1; } else { _bar_shape[0].x = _width - 1; _bar_shape[0].y = 1; _bar_shape[1].x = _width/2 ; _bar_shape[1].y = 1; _bar_shape[2].x = _width/2 + _height/2 - 1; _bar_shape[2].y = _height/2; _bar_shape[3].x = _width/2; _bar_shape[3].y = _height - 1; _bar_shape[4].x = _width - 1; _bar_shape[4].y = _height - 1; } } void SpinBox::OnSize(wxSizeEvent & event) { update_size(); event.Skip(); } void SpinBox::OnPaint(wxPaintEvent & event) { wxPaintDC pdc(this); if (!_backing_store) { return; } draw_area(_memdc); pdc.Blit(0, 0, _width, _height, &_memdc, 0, 0); } void SpinBox::on_update_timer (wxTimerEvent &ev) { // update value with current adjust float newval = _value; long deltatime = ::wxGetLocalTime() - _press_time; if (deltatime > 2) { newval += _curr_adjust * deltatime * deltatime * deltatime; } else { newval += _curr_adjust; } if (_snap_mode == IntegerSnap) { newval = nearbyintf (newval); } newval = max (min (newval, _upper_bound), _lower_bound); _value = newval; value_changed (get_value()); // emit update_value_str(); Refresh(false); _update_timer->Start (_curr_timeout, true); } void SpinBox::OnMouseEvents (wxMouseEvent &ev) { if (!IsEnabled()) { ev.Skip(); return; } if (ev.Entering() && !_dragging) { //_borderbrush.SetColour(_overbarcolor); _direction = ev.GetX() < _width/2 ? -1.0f : 1.0f; update_bar_shape(); _barbrush.SetColour(_overbarcolor); Refresh(false); } else if (ev.Leaving() && !_dragging) { _barbrush.SetColour(_bgcolor); //_borderbrush.SetColour(_bgcolor); _direction = 0; Refresh(false); } if (ev.Dragging() && _dragging) { ev.Skip(); } else if (ev.Moving()) { // do nothing float dirct = ev.GetX() < _width/2 ? -1.0f : 1.0f; if (dirct != _direction) { _direction = dirct; update_bar_shape(); Refresh(false); } } else if (ev.GetEventType() == wxEVT_MOUSEWHEEL) { float fscale = (ev.ShiftDown() ? 10.0f : 1.0f) * (ev.ControlDown() ? 2.0f: 1.0f); float newval; if (ev.GetWheelRotation() > 0) { //newval = _value + (_upper_bound - _lower_bound) * fscale; newval = _value + _increment * fscale; } else { newval = _value - _increment * fscale; } if (_snap_mode == IntegerSnap) { newval = nearbyintf (newval); } newval = max (min (newval, _upper_bound), _lower_bound); _value = newval; value_changed (get_value()); // emit update_value_str(); Refresh(false); } else if (ev.RightDown()) { this->PopupMenu ( _popup_menu, ev.GetX(), ev.GetY()); } else if (ev.RightUp()) { //this->PopupMenu ( _popup_menu, ev.GetX(), ev.GetY()); } else if (ev.ButtonDown() || ev.LeftDClick()) { CaptureMouse(); _dragging = true; _curr_timeout = -1; _barbrush.SetColour(_barcolor); pressed(); // emit if (ev.MiddleDown() && !ev.ControlDown()) { // start editing show_text_ctrl (); } else if (ev.LeftDown() && ev.ShiftDown()) { // set to default _value = max (min (_default_val, _upper_bound), _lower_bound); value_changed(get_value()); update_value_str(); } else { float newval = _value; _direction = ev.GetX() < _width/2 ? -1.0f : 1.0f; _curr_adjust = _increment * _direction; newval += _curr_adjust; if (_snap_mode == IntegerSnap) { newval = nearbyintf (newval); } newval = max (min (newval, _upper_bound), _lower_bound); _value = newval; value_changed (get_value()); // emit update_value_str(); _press_time = ::wxGetLocalTime(); // seconds _curr_timeout = 20; // for now _update_timer->Start(400, true); // oneshot update_bar_shape(); } Refresh(false); } else if (ev.ButtonUp()) { _dragging = false; _update_timer->Stop(); _curr_timeout = -1; ReleaseMouse(); if (ev.GetX() >= _width || ev.GetX() < 0 || ev.GetY() < 0 || ev.GetY() > _height) { //_borderbrush.SetColour(_bgcolor); _barbrush.SetColour(_bgcolor); Refresh(false); } else { //_borderbrush.SetColour(_overbarcolor); _barbrush.SetColour(_overbarcolor); Refresh(false); } if (ev.MiddleUp() && ev.ControlDown()) { // binding click bind_request(); // emit } released(); // emit } else { ev.Skip(); } } void SpinBox::OnFocusEvent (wxFocusEvent &ev) { if (ev.GetEventType() == wxEVT_KILL_FOCUS) { // focus kill _borderbrush.SetColour(_bgcolor); _barbrush.SetColour(_bgcolor); Refresh(false); } ev.Skip(); } void SpinBox::on_menu_events (wxCommandEvent &ev) { if (ev.GetId() == ID_BindMenuOp) { bind_request(); // emit } else if (ev.GetId() == ID_EditMenuOp) { show_text_ctrl (); } else if (ev.GetId() == ID_DefaultMenuOp) { _value = max (min (_default_val, _upper_bound), _lower_bound); value_changed(get_value()); update_value_str(); Refresh(false); } } void SpinBox::draw_area(wxDC & dc) { wxCoord w,h; dc.SetBackground(_bgbrush); dc.Clear(); dc.SetBrush(_borderbrush); dc.SetPen(_borderpen); //dc.DrawRectangle (0, 0, _width, _height); dc.DrawPolygon (8, _border_shape); dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush(_barbrush); if (_direction != 0.0f) { dc.DrawPolygon (5, _bar_shape); } dc.SetTextForeground(_textcolor); dc.GetTextExtent(_label_str, &w, &h); dc.DrawText (_label_str, 3, _height - h - 3); if (_showval_flag) { dc.SetTextForeground(_valuecolor); dc.GetTextExtent(_value_str, &w, &h); dc.DrawText (_value_str, _width - w - 3, _height - h - 3); } } void SpinBox::show_text_ctrl () { wxString valstr = get_precise_value_str(); if (!_text_ctrl) { _text_ctrl = new HidingTextCtrl(this, ID_TextCtrl, valstr, wxPoint(1,1), wxSize(_width - 2, _height - 2), wxTE_PROCESS_ENTER|wxTE_RIGHT); _text_ctrl->SetName (wxT("KeyAware")); _text_ctrl->SetFont(GetFont()); } _text_ctrl->SetValue (valstr); _text_ctrl->SetSelection (-1, -1); _text_ctrl->SetSize (_width - 2, _height - 2); _text_ctrl->Show(true); _text_ctrl->SetFocus(); } void SpinBox::hide_text_ctrl () { if (_text_ctrl && _text_ctrl->IsShown()) { _text_ctrl->Show(false); SetFocus(); } } void SpinBox::on_text_event (wxCommandEvent &ev) { if (ev.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) { // commit change bool good = false; bool neginf = false; double newval = 0.0; if (_scale_mode == ZeroGainMode && _text_ctrl->GetValue().Strip(wxString::both) == wxT("-inf")) { newval = 0.0; good = neginf = true; } else if (_text_ctrl->GetValue().ToDouble(&newval)) { good = true; } if (good) { if (_scale_mode == ZeroGainMode && !neginf) { newval = DB_CO(newval); } set_value ((float) newval); value_changed (get_value()); // emit } hide_text_ctrl(); } } BEGIN_EVENT_TABLE(SpinBox::HidingTextCtrl, wxTextCtrl) EVT_KILL_FOCUS (SpinBox::HidingTextCtrl::on_focus_event) END_EVENT_TABLE() void SpinBox::HidingTextCtrl::on_focus_event (wxFocusEvent & ev) { if (ev.GetEventType() == wxEVT_KILL_FOCUS) { Show(false); } } freqtweak-0.7.2/src/spin_box.hpp0000644000175200017520000001160011226173741015620 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __sooperlooper_gui_spin_box__ #define __sooperlooper_gui_spin_box__ #include #include namespace JLCui { class SpinBox : public wxWindow { public: // ctor(s) SpinBox(wxWindow * parent, wxWindowID id=-1, float lb=0.0f, float ub=1.0f, float val=0.5f, bool midibindable=true, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); virtual ~SpinBox(); enum ScaleMode { LinearMode = 0, ZeroGainMode }; enum SnapMode { NoSnap = 0, IntegerSnap }; virtual bool SetFont(const wxFont & fnt); void set_bounds (float lb, float ub); void get_bounds (float &lb, float &ub) { lb = _lower_bound; ub = _upper_bound; } void set_value (float val); float get_value (); void set_default_value (float val) { _default_val = val; } float get_default_value () { return _default_val; } void set_label (const wxString &label); wxString get_label () { return _label_str; } void set_units (const wxString &units); wxString get_units () { return _units_str; } void set_scale_mode (ScaleMode mode); ScaleMode get_scale_mode () { return _scale_mode; } void set_snap_mode (SnapMode mode); SnapMode get_snap_mode () { return _snap_mode; } void set_allow_outside_bounds (bool val) { _oob_flag = val; } bool get_allow_outside_bounds () { return _oob_flag; } void set_show_value (bool val) { _showval_flag = val; } bool get_show_value () { return _showval_flag; } void set_bg_color (const wxColour & col); wxColour & get_bg_color () { return _bgcolor; } void set_bar_color (const wxColour & col); wxColour & get_bar_color () { return _barcolor; } void set_text_color (const wxColour & col); wxColour & get_text_color () { return _textcolor; } void set_value_color (const wxColour & col); wxColour & get_value_color () { return _valuecolor; } void set_border_color (const wxColour & col); wxColour & get_border_color () { return _bordercolor; } void set_decimal_digits (int num); int get_decimal_digits () { return _decimal_digits; } float get_increment () { return _increment; } void set_increment (float val) { _increment = val; } SigC::Signal0 pressed; SigC::Signal0 released; SigC::Signal1 value_changed; SigC::Signal0 bind_request; protected: void OnPaint (wxPaintEvent &ev); void OnSize (wxSizeEvent &ev); void OnMouseEvents (wxMouseEvent &ev); void OnFocusEvent (wxFocusEvent &ev); void draw_area (wxDC & dc); void update_size(); void update_bar_shape(); void show_text_ctrl (); void hide_text_ctrl (); void on_text_event (wxCommandEvent &ev); void on_menu_events (wxCommandEvent &ev); void on_update_timer (wxTimerEvent &ev); void update_value_str(); wxString get_precise_value_str(); int _width, _height; wxBitmap * _backing_store; wxMemoryDC _memdc; wxMenu * _popup_menu; wxColour _bgcolor; wxBrush _bgbrush; wxColour _barcolor; wxColour _overbarcolor; wxBrush _barbrush; wxColour _bordercolor; wxBrush _borderbrush; wxPen _borderpen; wxBrush _linebrush; wxColour _textcolor; wxColour _valuecolor; float _value; float _default_val; float _lower_bound, _upper_bound; float _increment; float _direction; wxString _value_str; wxString _label_str; wxString _units_str; class HidingTextCtrl : public wxTextCtrl { public: HidingTextCtrl (wxWindow* par, wxWindowID id, const wxString & value = wxT(""), const wxPoint & pos = wxDefaultPosition, const wxSize & size = wxDefaultSize, long style = 0) : wxTextCtrl (par, id, value, pos, size, style) {} virtual ~HidingTextCtrl() {} void on_focus_event(wxFocusEvent &ev); private: DECLARE_EVENT_TABLE() }; HidingTextCtrl * _text_ctrl; bool _dragging; bool _ignoretext; long _press_time; float _val_scale; ScaleMode _scale_mode; SnapMode _snap_mode; int _decimal_digits; bool _oob_flag; bool _showval_flag; wxTimer *_update_timer; float _curr_adjust; long _curr_timeout; wxPoint _border_shape[8]; wxPoint _bar_shape[8]; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; }; #endif freqtweak-0.7.2/src/slider_bar.cpp0000644000175200017520000003761011226173741016111 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include #include #include #include "FTutils.hpp" #include "slider_bar.hpp" using namespace JLCui; using namespace std; // Convert a value in dB's to a coefficent #undef DB_CO #define DB_CO(g) ((g) > -144.0 ? pow(10.0, (g) * 0.05) : 0.0) #undef CO_DB #define CO_DB(v) (20.0 * log10(v)) static inline double gain_to_slider_position (double g) { if (g == 0) return 0; //return pow((6.0*log(g)/log(2.0)+192.0)/198.0, 8.0); return pow((6.0*log(g)/log(2.0)+198.0)/198.0, 8.0); } static inline double slider_position_to_gain (double pos) { if (pos == 0) { return 0.0; } /* XXX Marcus writes: this doesn't seem right to me. but i don't have a better answer ... */ //return pow (2.0,(sqrt(sqrt(sqrt(pos)))*198.0-192.0)/6.0); return pow (2.0,(sqrt(sqrt(sqrt(pos)))*198.0-198.0)/6.0); } enum { ID_TextCtrl = 8000, ID_EditMenuOp, ID_DefaultMenuOp, ID_BindMenuOp }; BEGIN_EVENT_TABLE(SliderBar, wxWindow) EVT_SIZE(SliderBar::OnSize) EVT_PAINT(SliderBar::OnPaint) EVT_MOUSE_EVENTS(SliderBar::OnMouseEvents) EVT_MOUSEWHEEL (SliderBar::OnMouseEvents) //EVT_TEXT (ID_TextCtrl, SliderBar::on_text_event) EVT_TEXT_ENTER (ID_TextCtrl, SliderBar::on_text_event) EVT_MENU (ID_EditMenuOp , SliderBar::on_menu_events) EVT_MENU (ID_DefaultMenuOp , SliderBar::on_menu_events) EVT_MENU (ID_BindMenuOp , SliderBar::on_menu_events) END_EVENT_TABLE() SliderBar::SliderBar(wxWindow * parent, wxWindowID id, float lb, float ub, float val, bool midibindable, const wxPoint& pos, const wxSize& size) : wxWindow(parent, id, pos, size) { _lower_bound = lb; _upper_bound = ub; _default_val = _value = val; _backing_store = 0; _indbm = 0; _dragging = false; _decimal_digits = 1; _text_ctrl = 0; _ignoretext = false; _oob_flag = false; _showval_flag = true; _show_ind_bar = false; _ind_value = 0.0f; _use_pending = false; _pending_val = 0.0f; _bgcolor.Set(30,30,30); _bgbrush.SetColour (_bgcolor); SetBackgroundColour (_bgcolor); SetThemeEnabled(false); _valuecolor.Set(244, 255, 178); _textcolor = *wxWHITE; _barcolor.Set(14, 50, 89); _overbarcolor.Set(20, 65, 104); _barbrush.SetColour(_barcolor); _bordercolor.Set(67, 83, 103); _borderpen.SetColour(_bordercolor); _borderpen.SetWidth(1); _borderbrush.SetColour(_bgcolor); _linebrush.SetColour(wxColour(154, 245, 168)); _bar_style = FromLeftStyle; _scale_mode = LinearMode; _snap_mode = NoSnap; _popup_menu = new wxMenu(wxT("")); _popup_menu->Append ( new wxMenuItem(_popup_menu, ID_EditMenuOp, wxT("Edit"))); _popup_menu->Append ( new wxMenuItem(_popup_menu, ID_DefaultMenuOp, wxT("Set to default"))); if (midibindable) { _popup_menu->AppendSeparator(); _popup_menu->Append ( new wxMenuItem(_popup_menu, ID_BindMenuOp, wxT("Learn MIDI Binding"))); } _indcolor.Set(47, 149, 133); _indbrush.SetColour(_indcolor); _indmaxcolor.Set(200, 20, 20); _indmaxbrush.SetColour(_indmaxcolor); update_size(); } SliderBar::~SliderBar() { _memdc.SelectObject(wxNullBitmap); if (_backing_store) { delete _backing_store; } _inddc.SelectObject(wxNullBitmap); if (_indbm) { delete _indbm; } } bool SliderBar::SetFont(const wxFont & fnt) { bool ret = wxWindow::SetFont(fnt); _memdc.SetFont(fnt); do_redraw(); return ret; } void SliderBar::set_style (BarStyle md) { if (md != _bar_style) { _bar_style = md; do_redraw(); } } void SliderBar::set_snap_mode (SnapMode md) { if (md != _snap_mode) { _snap_mode = md; } } void SliderBar::set_scale_mode (ScaleMode mode) { if (mode != _scale_mode) { _scale_mode = mode; update_value_str(); do_redraw(); } } void SliderBar::set_bounds (float lb, float ub) { if (_lower_bound != lb || _upper_bound != ub) { _lower_bound = lb; _upper_bound = ub; // force value to within if (_value < _lower_bound) { _value = _lower_bound; update_value_str(); do_redraw(); } else if (_value > _upper_bound) { _value = _upper_bound; update_value_str(); do_redraw(); } } } void SliderBar::set_label (const wxString & label) { _label_str = label; do_redraw(); } void SliderBar::set_units (const wxString & units) { _units_str = units.Strip(wxString::both); if (!_units_str.empty()) { _units_str = wxT(" ") + _units_str; } update_value_str(); do_redraw(); } void SliderBar::set_decimal_digits (int val) { _decimal_digits = val; update_value_str(); do_redraw(); } void SliderBar::set_value (float val, bool refresh) { float newval = val; if (_scale_mode == ZeroGainMode) { newval = gain_to_slider_position (val); } // if (_snap_mode == IntegerSnap) { // newval = nearbyintf (newval); // } if (!_oob_flag) { newval = min (newval, _upper_bound); newval = max (newval, _lower_bound); } if (_dragging) { // don't update current value if mid drag _use_pending = true; _pending_val = newval; return; } if (newval != _value) { _value = newval; update_value_str(); if (refresh) { do_redraw(); } } } void SliderBar::set_indicator_value (float val) { float newval = val; if (_scale_mode == ZeroGainMode) { newval = gain_to_slider_position (val); } if (!_oob_flag) { newval = f_min (newval, _upper_bound); newval = f_max (newval, _lower_bound); } if (newval != _ind_value) { _ind_value = newval; Refresh(false); } } float SliderBar::get_value () { if (_scale_mode == ZeroGainMode) { return slider_position_to_gain(_value); } else { return _value; } } float SliderBar::get_indicator_value () { if (_scale_mode == ZeroGainMode) { return slider_position_to_gain(_ind_value); } else { return _ind_value; } } void SliderBar::update_value_str() { if (_scale_mode == ZeroGainMode) { float gain = slider_position_to_gain(_value); if (gain == 0) { _value_str.Printf(wxT("-inf%s"), _units_str.c_str()); } else { _value_str.Printf(wxT("%.*f%s"), _decimal_digits, CO_DB(gain), _units_str.c_str()); } } else { _value_str.Printf(wxT("%.*f%s"), _decimal_digits, _value, _units_str.c_str()); } } wxString SliderBar::get_precise_value_str() { wxString valstr; if (_scale_mode == ZeroGainMode) { float gain = slider_position_to_gain(_value); if (gain == 0) { valstr.Printf(wxT("-inf")); } else if (_snap_mode == IntegerSnap) { valstr.Printf(wxT("%g"), CO_DB(gain)); } else { valstr.Printf(wxT("%.8f"), CO_DB(gain)); } } else { if (_snap_mode == IntegerSnap) { valstr.Printf(wxT("%g"), _value); } else { valstr.Printf(wxT("%.8f"), _value); } } return valstr; } void SliderBar::set_bg_color (const wxColour & col) { _bgcolor = col; _bgbrush.SetColour (col); SetBackgroundColour (col); do_redraw(); } void SliderBar::set_text_color (const wxColour & col) { _textcolor = col; do_redraw(); } void SliderBar::set_border_color (const wxColour & col) { _bordercolor = col; _borderbrush.SetColour (col); do_redraw(); } void SliderBar::set_indicator_bar_color (const wxColour & col) { _indcolor = col; _indbrush.SetColour (col); do_redraw(); } void SliderBar::set_indicator_max_bar_color (const wxColour & col) { _indmaxcolor = col; _indmaxbrush.SetColour (col); do_redraw(); } void SliderBar::set_bar_color (const wxColour & col) { _barcolor = col; _barbrush.SetColour (col); do_redraw(); } void SliderBar::update_size() { GetClientSize(&_width, &_height); if (_width > 0 && _height > 0) { _val_scale = (_upper_bound - _lower_bound) / (_width); _memdc.SelectObject (wxNullBitmap); if (_backing_store) { delete _backing_store; } _backing_store = new wxBitmap(_width, _height); _memdc.SelectObject(*_backing_store); _memdc.SetFont(GetFont()); _inddc.SelectObject (wxNullBitmap); if (_indbm) { delete _indbm; } _indbm = new wxBitmap(_width, _height); _inddc.SelectObject(*_indbm); } } void SliderBar::OnSize(wxSizeEvent & event) { update_size(); do_redraw(); event.Skip(); } void SliderBar::do_redraw () { if (!_backing_store) { return; } draw_area(_memdc); Refresh(false); } void SliderBar::OnPaint(wxPaintEvent & event) { wxPaintDC pdc(this); //draw_area(_memdc); if (_show_ind_bar) { // first blit memdc into the inddc _inddc.Blit(0, 0, _width, _height, &_memdc, 0, 0); // draw the indicator draw_ind (_inddc); // final blit pdc.Blit(0, 0, _width, _height, &_inddc, 0, 0); } else { pdc.Blit(0, 0, _width, _height, &_memdc, 0, 0); } } void SliderBar::OnMouseEvents (wxMouseEvent &ev) { if (!IsEnabled()) { ev.Skip(); return; } if (ev.Entering() && !_dragging) { _barbrush.SetColour(_overbarcolor); do_redraw(); } else if (ev.Leaving() && !_dragging) { _barbrush.SetColour(_barcolor); do_redraw(); } if (ev.Dragging() && _dragging) { int delta = ev.GetX() - _last_x; float fdelta = delta * _val_scale; if (ev.ControlDown()) { fdelta *= 0.5f; if (ev.ShiftDown()) { fdelta *= 0.5f; } } float newval = _value + fdelta; //cerr << "dragging: " << ev.GetX() << " " << delta << " " << fdelta << " " << newval << endl; if (_snap_mode == IntegerSnap) { newval = nearbyintf (newval); } newval = max (min (newval, _upper_bound), _lower_bound); if (newval != _value) { _value = newval; value_changed (get_value()); // emit update_value_str(); do_redraw(); //cerr << "new val is: " << _value << endl; } _last_x = ev.GetX(); } else if (ev.Moving()) { // do nothing } else if (ev.GetEventType() == wxEVT_MOUSEWHEEL) { // don't get the events right now float fscale = 0.02f * (ev.ControlDown() ? 0.5f: 1.0f); float newval; if (ev.GetWheelRotation() > 0) { newval = _value + (_upper_bound - _lower_bound) * fscale; } else { newval = _value - (_upper_bound - _lower_bound) * fscale; } if (_snap_mode == IntegerSnap) { newval = nearbyintf (newval); } newval = max (min (newval, _upper_bound), _lower_bound); _value = newval; value_changed (get_value()); // emit update_value_str(); do_redraw(); } else if (ev.RightDown()) { this->PopupMenu ( _popup_menu, ev.GetX(), ev.GetY()); } else if (ev.RightUp()) { //this->PopupMenu ( _popup_menu, ev.GetX(), ev.GetY()); } else if (ev.ButtonDown()) { CaptureMouse(); _dragging = true; _last_x = ev.GetX(); pressed(); // emit if (ev.MiddleDown() && !ev.ControlDown()) { // set immediately float newval = (ev.GetX() * _val_scale) + _lower_bound; if (_snap_mode == IntegerSnap) { newval = nearbyintf (newval); } _value = newval; value_changed (get_value()); // emit update_value_str(); do_redraw(); } else if (ev.LeftDown() && ev.ShiftDown()) { // set to default _value = max (min (_default_val, _upper_bound), _lower_bound); value_changed(get_value()); update_value_str(); do_redraw(); } } else if (ev.ButtonUp()) { _dragging = false; ReleaseMouse(); if (_use_pending) { // This didn't really work //if (_pending_val != _value) { // _value = _pending_val; // update_value_str(); //} _use_pending = false; } if (ev.GetX() >= _width || ev.GetX() < 0 || ev.GetY() < 0 || ev.GetY() > _height) { _barbrush.SetColour(_barcolor); do_redraw(); } else { _barbrush.SetColour(_overbarcolor); do_redraw(); } if (ev.MiddleUp() && ev.ControlDown()) { // binding click bind_request(); // emit } released(); // emit } else if (ev.ButtonDClick()) { // this got annoying //show_text_ctrl (); } else { ev.Skip(); } } void SliderBar::on_menu_events (wxCommandEvent &ev) { if (ev.GetId() == ID_BindMenuOp) { bind_request(); // emit } else if (ev.GetId() == ID_EditMenuOp) { show_text_ctrl (); } else if (ev.GetId() == ID_DefaultMenuOp) { _value = max (min (_default_val, _upper_bound), _lower_bound); value_changed(get_value()); update_value_str(); do_redraw(); } } void SliderBar::draw_area(wxDC & dc) { wxCoord w,h; int pixw; dc.SetBackground(_bgbrush); dc.Clear(); dc.SetBrush(_borderbrush); dc.SetPen(_borderpen); dc.DrawRectangle (0, 0, _width, _height); dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush(_barbrush); if (_bar_style == FromLeftStyle) { pixw = (int) ((_value - _lower_bound) / _val_scale); dc.DrawRectangle (1, 1, pixw-1, _height-2); } else if (_bar_style == FromRightStyle) { pixw = (int) ((_upper_bound - _value) / _val_scale); dc.DrawRectangle (pixw, 1, _width - pixw - 1, _height-2); } if (_bar_style != HiddenStyle) { dc.SetBrush(_linebrush); pixw = (int) ((_value - _lower_bound) / _val_scale); dc.DrawRectangle (pixw - 1, 1, 2, _height-2); } dc.SetTextForeground(_textcolor); dc.GetTextExtent(_label_str, &w, &h); dc.DrawText (_label_str, 3, _height - h - 3); if (_showval_flag) { dc.SetTextForeground(_valuecolor); dc.GetTextExtent(_value_str, &w, &h); dc.DrawText (_value_str, _width - w - 3, _height - h - 3); } } void SliderBar::draw_ind(wxDC & dc) { int pixw; dc.SetPen(*wxTRANSPARENT_PEN); if (_bar_style == FromLeftStyle) { pixw = (int) ((_ind_value - _lower_bound) / _val_scale); if (pixw > 0) { if (_ind_value >= _upper_bound) { dc.SetBrush(_indmaxbrush); } else { dc.SetBrush(_indbrush); } dc.DrawRectangle (1, 1, pixw-1, 1); dc.DrawRectangle (1, _height - 2, pixw-1, 1); } } else if (_bar_style == FromRightStyle) { pixw = (int) ((_upper_bound - _ind_value) / _val_scale); if (pixw < _width) { if (_ind_value >= _upper_bound) { dc.SetBrush(_indmaxbrush); } else { dc.SetBrush(_indbrush); } dc.DrawRectangle (pixw, 1, _width - pixw -1, 2); dc.DrawRectangle (pixw, _height - 2, _width - pixw - 1, 1); } } pixw = (int) ((_ind_value - _lower_bound) / _val_scale); if (pixw > 0) { if (_ind_value >= _upper_bound) { dc.SetBrush(_indmaxbrush); } else { dc.SetBrush(_indbrush); } dc.DrawRectangle (pixw - 2, 1, 2, _height-2); } } void SliderBar::show_text_ctrl () { wxString valstr = get_precise_value_str(); if (!_text_ctrl) { _text_ctrl = new HidingTextCtrl(this, ID_TextCtrl, valstr, wxPoint(1,1), wxSize(_width - 2, _height - 2), wxTE_PROCESS_ENTER|wxTE_RIGHT); _text_ctrl->SetName (wxT("KeyAware")); _text_ctrl->SetFont(GetFont()); } _text_ctrl->SetValue (valstr); _text_ctrl->SetSelection (-1, -1); _text_ctrl->SetSize (_width - 2, _height - 2); _text_ctrl->Show(true); _text_ctrl->SetFocus(); } void SliderBar::hide_text_ctrl () { if (_text_ctrl && _text_ctrl->IsShown()) { _text_ctrl->Show(false); SetFocus(); } } void SliderBar::on_text_event (wxCommandEvent &ev) { if (ev.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) { // commit change bool good = false; bool neginf = false; double newval = 0.0; if (_scale_mode == ZeroGainMode && _text_ctrl->GetValue().Strip(wxString::both) == wxT("-inf")) { newval = 0.0; good = neginf = true; } else if (_text_ctrl->GetValue().ToDouble(&newval)) { good = true; } if (good) { if (_scale_mode == ZeroGainMode && !neginf) { newval = DB_CO(newval); } set_value ((float) newval); value_changed (get_value()); // emit } hide_text_ctrl(); } } BEGIN_EVENT_TABLE(SliderBar::HidingTextCtrl, wxTextCtrl) EVT_KILL_FOCUS (SliderBar::HidingTextCtrl::on_focus_event) END_EVENT_TABLE() void SliderBar::HidingTextCtrl::on_focus_event (wxFocusEvent & ev) { if (ev.GetEventType() == wxEVT_KILL_FOCUS) { Show(false); } } freqtweak-0.7.2/src/slider_bar.hpp0000644000175200017520000001264211226173741016114 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __sooperlooper_gui_slider_bar__ #define __sooperlooper_gui_slider_bar__ #include #include namespace JLCui { class SliderBar : public wxWindow { public: // ctor(s) SliderBar(wxWindow * parent, wxWindowID id=-1, float lb=0.0f, float ub=1.0f, float val=0.5f, bool midibindable=true, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); virtual ~SliderBar(); enum BarStyle { FromLeftStyle=0, CenterStyle, FromRightStyle, HiddenStyle }; enum ScaleMode { LinearMode = 0, ZeroGainMode }; enum SnapMode { NoSnap = 0, IntegerSnap }; virtual bool SetFont(const wxFont & fnt); void set_style (BarStyle md); BarStyle get_style () { return _bar_style;} void set_bounds (float lb, float ub); void get_bounds (float &lb, float &ub) { lb = _lower_bound; ub = _upper_bound; } void set_value (float val, bool refresh=true); float get_value (); void set_show_indicator_bar (bool flag) { _show_ind_bar = flag; } bool get_show_indicator_bar () { return _show_ind_bar; } void set_indicator_value (float val); float get_indicator_value (); void set_default_value (float val) { _default_val = val; } float get_default_value () { return _default_val; } void set_label (const wxString &label); wxString get_label () { return _label_str; } void set_units (const wxString &units); wxString get_units () { return _units_str; } void set_scale_mode (ScaleMode mode); ScaleMode get_scale_mode () { return _scale_mode; } void set_snap_mode (SnapMode mode); SnapMode get_snap_mode () { return _snap_mode; } void set_allow_outside_bounds (bool val) { _oob_flag = val; } bool get_allow_outside_bounds () { return _oob_flag; } void set_show_value (bool val) { _showval_flag = val; } bool get_show_value () { return _showval_flag; } void set_bg_color (const wxColour & col); wxColour & get_bg_color () { return _bgcolor; } void set_bar_color (const wxColour & col); wxColour & get_bar_color () { return _barcolor; } void set_text_color (const wxColour & col); wxColour & get_text_color () { return _textcolor; } void set_value_color (const wxColour & col); wxColour & get_value_color () { return _valuecolor; } void set_border_color (const wxColour & col); wxColour & get_border_color () { return _bordercolor; } void set_indicator_bar_color (const wxColour & col); wxColour & get_indicator_bar_color () { return _indcolor; } void set_indicator_max_bar_color (const wxColour & col); wxColour & get_indicator_max_bar_color () { return _indmaxcolor; } void set_decimal_digits (int num); int get_decimal_digits () { return _decimal_digits; } SigC::Signal0 pressed; SigC::Signal0 released; SigC::Signal1 value_changed; SigC::Signal0 bind_request; protected: void OnPaint (wxPaintEvent &ev); void OnSize (wxSizeEvent &ev); void OnMouseEvents (wxMouseEvent &ev); void do_redraw (); void draw_area (wxDC & dc); void draw_ind (wxDC & dc); void update_size(); void show_text_ctrl (); void hide_text_ctrl (); void on_text_event (wxCommandEvent &ev); void on_menu_events (wxCommandEvent &ev); void update_value_str(); wxString get_precise_value_str(); int _width, _height; wxBitmap * _backing_store; wxMemoryDC _memdc; wxMemoryDC _inddc; wxBitmap * _indbm; wxMenu * _popup_menu; wxColour _bgcolor; wxBrush _bgbrush; wxColour _barcolor; wxColour _overbarcolor; wxBrush _barbrush; wxColour _bordercolor; wxBrush _borderbrush; wxPen _borderpen; wxBrush _linebrush; wxColor _indcolor; wxColor _indmaxcolor; wxBrush _indbrush; wxBrush _indmaxbrush; wxColour _textcolor; wxColour _valuecolor; float _value; float _default_val; bool _show_ind_bar; float _ind_value; float _lower_bound, _upper_bound; bool _use_pending; float _pending_val; wxString _value_str; wxString _label_str; wxString _units_str; BarStyle _bar_style; class HidingTextCtrl : public wxTextCtrl { public: HidingTextCtrl (wxWindow* par, wxWindowID id, const wxString & value = wxT(""), const wxPoint & pos = wxDefaultPosition, const wxSize & size = wxDefaultSize, long style = 0) : wxTextCtrl (par, id, value, pos, size, style) {} virtual ~HidingTextCtrl() {} void on_focus_event(wxFocusEvent &ev); private: DECLARE_EVENT_TABLE() }; HidingTextCtrl * _text_ctrl; bool _dragging; int _last_x; bool _ignoretext; float _val_scale; ScaleMode _scale_mode; SnapMode _snap_mode; int _decimal_digits; bool _oob_flag; bool _showval_flag; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; }; #endif freqtweak-0.7.2/src/FTmodRandomize.cpp0000644000175200017520000001027311226173741016661 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTmodRandomize.hpp" #include #include #include using namespace std; using namespace PBD; FTmodRandomize::FTmodRandomize (nframes_t samplerate, unsigned int fftn) : FTmodulatorI ("Randomize","Randomize", samplerate, fftn) { } FTmodRandomize::FTmodRandomize (const FTmodRandomize & other) : FTmodulatorI ("Randomize", "Randomize", other._sampleRate, other._fftN) { } void FTmodRandomize::initialize() { _lastframe = 0; _rate = new Control (Control::FloatType, "rate", "Rate", "Hz"); _rate->_floatLB = 0.0; _rate->_floatUB = 20.0; _rate->setValue (0.0f); _controls.push_back (_rate); _minval = new Control (Control::FloatType, "min_val", "Min Val", "%"); _minval->_floatLB = 0.0; _minval->_floatUB = 100.0; _minval->setValue (_minval->_floatLB); _controls.push_back (_minval); _maxval = new Control (Control::FloatType, "max_val", "Max Val", "%"); _maxval->_floatLB = 0.0; _maxval->_floatUB = 100.0; _maxval->setValue (_maxval->_floatUB); _controls.push_back (_maxval); _minfreq = new Control (Control::FloatType, "min_freq", "Min Freq", "Hz"); _minfreq->_floatLB = 0.0; _minfreq->_floatUB = _sampleRate / 2; _minfreq->setValue (_minfreq->_floatLB); _controls.push_back (_minfreq); _maxfreq = new Control (Control::FloatType, "max_freq", "Max Freq", "Hz"); _maxfreq->_floatLB = 0.0; _maxfreq->_floatUB = _sampleRate / 2; _maxfreq->setValue (_maxfreq->_floatUB); _controls.push_back (_maxfreq); srand(0); _inited = true; } FTmodRandomize::~FTmodRandomize() { if (!_inited) return; _controls.clear(); delete _rate; delete _minfreq; delete _maxfreq; delete _minval; delete _maxval; } void FTmodRandomize::modulate (nframes_t current_frame, fft_data * fftdata, unsigned int fftn, sample_t * timedata, nframes_t nframes) { TentativeLockMonitor lm (_specmodLock, __LINE__, __FILE__); if (!lm.locked() || !_inited || _bypassed) return; float rate = 1.0; float ub,lb, tmplb, tmpub; float * filter; unsigned int len; _rate->getValue (rate); if (rate == 0.0) return; unsigned int minbin, maxbin; float minval, maxval; float minfreq,maxfreq; double samps = _sampleRate / rate; _minval->getValue (minval); _maxval->getValue (maxval); if (minval > maxval) { minval = maxval; } _minfreq->getValue (minfreq); _maxfreq->getValue (maxfreq); if (minfreq >= maxfreq) { return; } double delta = current_frame - _lastframe; if (delta >= samps) { // fprintf (stderr, "randomize at %lu : samps=%g s*c=%g s*e=%g \n", (unsigned long) current_frame, samps, (current_frame/samps), ((current_frame + nframes)/samps) ); for (SpecModList::iterator iter = _specMods.begin(); iter != _specMods.end(); ++iter) { FTspectrumModifier * sm = (*iter); if (sm->getBypassed()) continue; filter = sm->getValues(); sm->getRange(tmplb, tmpub); len = sm->getLength(); lb = tmplb + (tmpub-tmplb) * minval * 0.01; ub = tmplb + (tmpub-tmplb) * maxval * 0.01; // cerr << " lb: " << lb << " ub: " << ub // << " minval: " << minval << " maxval: " << maxval // << " tmlb: " << tmplb << " tmpub: " << tmpub // << endl; minbin = (int) ((minfreq*2/ _sampleRate) * len); maxbin = (int) ((maxfreq*2/ _sampleRate) * len); // crap random for (unsigned int i=minbin; i < maxbin; ++i) { filter[i] = lb + (float) ((ub-lb) * rand() / (RAND_MAX+1.0)); } sm->setDirty(true); } _lastframe = current_frame; } } freqtweak-0.7.2/src/FTmodRandomize.hpp0000644000175200017520000000263111226173741016665 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTMODRANDOMIZE_HPP__ #define __FTMODRANDOMIZE_HPP__ #include "FTmodulatorI.hpp" class FTmodRandomize : public FTmodulatorI { public: FTmodRandomize(nframes_t samplerate, unsigned int fftn); FTmodRandomize (const FTmodRandomize & other); virtual ~FTmodRandomize(); FTmodulatorI * clone() { return new FTmodRandomize(*this); } void initialize(); void modulate (nframes_t current_frame, fft_data * fftdata, unsigned int fftn, sample_t * timedata, nframes_t nframes); protected: Control * _rate; Control * _minfreq; Control * _maxfreq; Control * _minval; Control * _maxval; nframes_t _lastframe; }; #endif freqtweak-0.7.2/src/FTpresetBlender.cpp0000644000175200017520000001156011226173741017027 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTpresetBlender.hpp" #include "FTioSupport.hpp" #include "FTprocI.hpp" #include "FTprocessPath.hpp" #include "FTconfigManager.hpp" #include "FTspectralEngine.hpp" #include "FTspectrumModifier.hpp" FTpresetBlender::FTpresetBlender(FTconfigManager * confman) : _configMan(confman) { // add two elements both intially null _presetList.push_back(0); _presetList.push_back(0); _presetNames.push_back(""); _presetNames.push_back(""); } FTpresetBlender::~FTpresetBlender() { for (unsigned int n=0; n < _presetList.size(); ++n) { if (_presetList[n]) { delete _presetList[n]; } } _presetList.clear(); } bool FTpresetBlender::setPreset(const string & name, int index) { // try to load it up and compare the resulting FTprocs to the // currently active ones if (index >= (int) _presetList.size()) { return false; } // delete old one no matter what if (_presetList[index]) { delete _presetList[index]; _presetList[index] = 0; } vector > * procvec = new vector > (); bool succ = _configMan->loadSettings (name.c_str(), false, true, *procvec, false); if (!succ) { delete procvec; return false; } FTioSupport * iosup = FTioSupport::instance(); if ((int)procvec->size() != iosup->getActivePathCount()) { delete procvec; return false; } for ( unsigned int i=0; i < procvec->size(); i++) { FTprocessPath * procpath = iosup->getProcessPath(i); if (!procpath) { delete procvec; return false; // shouldnt happen } vector & pvec = (*procvec)[i]; FTspectralEngine * engine = procpath->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; // compare the proctype if (pvec.size() <= n || pm->getName() != pvec[n]->getName()) { fprintf (stderr, "mismatch at %d %d: %s %u\n", i, n, pm->getName().c_str(), pvec.size()); delete procvec; return false; } } } // if we got here we are a match _presetList[index] = procvec; _presetNames[index] = name; return true; } string FTpresetBlender::getPreset(int index) { if (index < (int) _presetNames.size()) { return _presetNames[index]; } return ""; } bool FTpresetBlender::setBlend (unsigned int specmod_n, unsigned int filt_n, float val) { // for the given filter given by specmod_n, filt_n, set the ratio to use // and adjust the active filters accordingly // TODO: support more than 2 presets // Assume that both proc lists have the same structure if (!_presetList[0] || !_presetList[1]) { return false; } FTioSupport * iosup = FTioSupport::instance(); vector > * procvec0 = _presetList[0]; vector > * procvec1 = _presetList[1]; for (unsigned int chan=0; chan < procvec0->size(); ++chan) { vector & procvec0_p = (*procvec0)[chan]; vector & procvec1_p = (*procvec1)[chan]; FTprocessPath * procpath = iosup->getProcessPath((int) chan); if (!procpath) continue; // shouldnt happen FTspectralEngine *engine = procpath->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); if (specmod_n < procvec0_p.size() && specmod_n < procvec1_p.size() && specmod_n < procmods.size()) { FTspectrumModifier * targFilt = procmods[specmod_n]->getFilter(filt_n); FTspectrumModifier * filt0 = procvec0_p[specmod_n]->getFilter(filt_n); FTspectrumModifier * filt1 = procvec1_p[specmod_n]->getFilter(filt_n); if (targFilt && filt0 && filt1) { // do the blend blendFilters (targFilt, filt0, filt1, val); } } } return true; } float FTpresetBlender::getBlend (unsigned int specmod_n, unsigned int filt_n) { return 0.0; } void FTpresetBlender::blendFilters (FTspectrumModifier * targFilt, FTspectrumModifier *filt0, FTspectrumModifier *filt1, float val) { float * targvals = targFilt->getValues(); float * filt0vals = filt0->getValues(); float * filt1vals = filt1->getValues(); for (int i=0; i < targFilt->getLength(); ++i) { targvals[i] = val*filt0vals[i] + (1.0-val)*filt1vals[i]; } } freqtweak-0.7.2/src/FTpresetBlender.hpp0000644000175200017520000000316211226173741017033 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPRESETBLENDER_HPP__ #define __FTPRESETBLENDER_HPP__ #include "FTtypes.hpp" #include #include #include using namespace std; class FTprocI; class FTconfigManager; class FTspectrumModifier; class FTpresetBlender { public: FTpresetBlender(FTconfigManager * confman); virtual ~FTpresetBlender(); bool setPreset(const string & name, int index); string getPreset(int index); bool setBlend (unsigned int specmod_n, unsigned int filt_n, float val); float getBlend (unsigned int specmod_n, unsigned int filt_n); protected: void blendFilters (FTspectrumModifier * targFilt, FTspectrumModifier *filt0, FTspectrumModifier *filt1, float val); vector > *> _presetList; vector _presetNames; FTconfigManager * _configMan; FTpresetBlender * _presetBlender; }; #endif freqtweak-0.7.2/src/FTupdateToken.hpp0000644000175200017520000000247311226173741016524 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTUPDATETOKEN_HPP__ #define __FTUPDATETOKEN_HPP__ class FTupdateToken { public: FTupdateToken() : _updated(false), _ignore(false) {}; virtual ~FTupdateToken(){} void setUpdated (bool flag) { _updated = flag; } // this is as close of a test-and-set as I need bool getUpdated (bool tas=false) { if (_updated) { _updated = tas; return true; } return false; } void setIgnore (bool flag) { _ignore = flag; } bool getIgnore() { return _ignore;} protected: volatile bool _updated; bool _ignore; }; #endif freqtweak-0.7.2/src/FTjackSupport.cpp0000644000175200017520000004002611226173741016535 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include using namespace std; #include "FTjackSupport.hpp" #include "FTprocessPath.hpp" #include "FTspectralEngine.hpp" #include "FTtypes.hpp" #include FTjackSupport::FTjackSupport(const char * name, const char * dir) : _inited(false), _jackClient(0), _activePathCount(0), _activated(false), _bypassed(false) { // init process path info for (int i=0; i < FT_MAXPATHS; i++) { _pathInfos[i] = 0; } _name = name; _jackserv = dir; } FTjackSupport::~FTjackSupport() { printf ("jack support destruct\n"); // init process path info for (int i=0; i < FT_MAXPATHS; i++) { if (_pathInfos[i]) { delete _pathInfos[i]; } } if (_inited && _jackClient) { close(); //jack_client_close ( _jackClient ); } } /** * Initialize and connect to jack server. * Returns false if failed */ bool FTjackSupport::init() { #ifdef HAVE_JACK_CLIENT_OPEN jack_options_t options = JackNullOption; jack_status_t status; const char *server_name = NULL; if (!_jackserv.empty()) { server_name = _jackserv.c_str(); } // jack_client_name = client_name; /* might be reset below */ if (_name.empty()) { _name = "freqtweak"; } _jackClient = jack_client_open (_name.c_str(), options, &status, server_name); if (!_jackClient) { fprintf (stderr, "JACK Error: No good client name or JACK server %s not running?\n", _jackserv.c_str()); _inited = false; return false; } if (status & JackServerStarted) { fprintf(stderr,"JACK server started\n"); } if (status & JackNameNotUnique) { _name = jack_get_client_name (_jackClient); } #else char namebuf[100]; /* try to become a client of the JACK server */ if (_name.empty()) { // find a name predictably for (int i=1; i < 10; i++) { snprintf(namebuf, sizeof(namebuf)-1, "freqtweak_%d", i); if ((_jackClient = jack_client_new (namebuf)) != 0) { _name = namebuf; break; } } } else { // try the passed name, or base a predictable name from it if ((_jackClient = jack_client_new (_name.c_str())) == 0) { for (int i=1; i < 10; i++) { snprintf(namebuf, sizeof(namebuf)-1, "%s_%d", _name.c_str(), i); if ((_jackClient = jack_client_new (namebuf)) != 0) { _name = namebuf; break; } } } } if (!_jackClient) { fprintf (stderr, "JACK Error: No good client name or JACK server not running?\n"); _inited = false; return false; } #endif /* tell the JACK server to call `process()' whenever there is work to be done. */ jack_set_process_callback (_jackClient, FTjackSupport::processCallback, 0); /* tell the JACK server to call `srate()' whenever the sample rate of the system changes. */ jack_set_sample_rate_callback (_jackClient, FTjackSupport::srateCallback, 0); /* tell the JACK server to call `jack_shutdown()' if it ever shuts down, either entirely, or if it just decides to stop calling us. */ jack_on_shutdown (_jackClient, FTjackSupport::jackShutdown, 0); /* display the current sample rate. once the client is activated (see below), you should rely on your own sample rate callback (see above) for this value. */ _sampleRate = jack_get_sample_rate (_jackClient); //printf ("engine sample rate: %lu\n", _sampleRate); _inited = true; return true; } bool FTjackSupport::startProcessing() { if (!_jackClient) return false; if (jack_activate (_jackClient)) { fprintf (stderr, "Error: cannot activate jack client!\n"); return false; } _activated = true; return true; } bool FTjackSupport::stopProcessing() { if (!_jackClient) return false; // load up latest port connections for possible restoring for (int i=0; i < _activePathCount; ++i) { const char ** ports; if ((ports = getConnectedInputPorts (i)) != NULL) free (ports); if ((ports = getConnectedOutputPorts (i)) != NULL) free (ports); } if (jack_deactivate (_jackClient)) { fprintf (stderr, "Error: cannot deactivate jack client!\n"); return false; } //printf ("deactivated jack\n"); _activated = false; return true; } bool FTjackSupport::close() { if (_inited && _jackClient) { stopProcessing(); jack_client_close ( _jackClient ); _jackClient = 0; _inited = false; return true; } return false; } FTprocessPath * FTjackSupport::setProcessPathActive (int index, bool active) { if (!_inited || !_jackClient) return 0; char nbuf[30]; PathInfo *tmppath; FTprocessPath * ppath; if (index >=0 && index < FT_MAXPATHS) { if (_pathInfos[index]) { tmppath = _pathInfos[index]; ppath = tmppath->procpath; if (active) { if (tmppath->active) { //already active, do nothing return ppath; } } else { if (tmppath->active) { // detach ports jack_port_unregister (_jackClient, tmppath->inputport); jack_port_unregister (_jackClient, tmppath->outputport); // just mark it inactive but not destroy it tmppath->active = false; _activePathCount--; //we are not deleting old one, we reuse it later if necessary } return 0; } } else { // it is a new one, construct new processPath if (active) { tmppath = new PathInfo(); ppath = new FTprocessPath(); } else { return 0; } } // it only gets here if it is brand new, or going from inactive->active sprintf(nbuf,"in_%d", index + 1); tmppath->inputport = jack_port_register (_jackClient, nbuf, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); sprintf(nbuf,"out_%d", index + 1); tmppath->outputport = jack_port_register (_jackClient, nbuf, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); jack_port_set_latency (tmppath->outputport, ppath->getSpectralEngine()->getLatency()); tmppath->procpath = ppath; tmppath->active = true; _pathInfos[index] = tmppath; ppath->setId (index); _activePathCount++; return ppath; } return false; } const char * FTjackSupport::getInputPortName(int index) { if (index >=0 && index < FT_MAXPATHS) { if (_pathInfos[index]) { return jack_port_name(_pathInfos[index]->inputport); } } return NULL; } const char * FTjackSupport::getOutputPortName(int index) { if (index >=0 && index < FT_MAXPATHS) { if (_pathInfos[index]) { return jack_port_name(_pathInfos[index]->outputport); } } return NULL; } bool FTjackSupport::connectPathInput (int index, const char *inname) { if (!_jackClient) return false; if (index >=0 && index < FT_MAXPATHS && _pathInfos[index]) { if (jack_connect (_jackClient, inname, jack_port_name(_pathInfos[index]->inputport))) { fprintf (stderr, "JACK error: cannot connect input port: %s -> %s\n", inname, jack_port_name(_pathInfos[index]->inputport)); return false; } _pathInfos[index]->inconn_list.push_back (inname); return true; } return false; } bool FTjackSupport::connectPathOutput (int index, const char *outname) { if (!_jackClient) return false; if (index >=0 && index < FT_MAXPATHS && _pathInfos[index]) { if (jack_connect (_jackClient, jack_port_name(_pathInfos[index]->outputport), outname)) { fprintf (stderr, "JACK error: cannot connect output port: %s -> %s\n", jack_port_name(_pathInfos[index]->outputport), outname); return false; } _pathInfos[index]->outconn_list.push_back (outname); return true; } return false; } bool FTjackSupport::disconnectPathInput (int index, const char *inname) { if (!_jackClient) return false; if (index >=0 && index < FT_MAXPATHS && _pathInfos[index]) { if (inname) { if (jack_disconnect (_jackClient, inname, jack_port_name(_pathInfos[index]->inputport))) { fprintf (stderr, "cannot disconnect input port\n"); return false; } _pathInfos[index]->inconn_list.remove (inname); return true; } else { // disconnect all from our input port const char ** portnames = jack_port_get_connections (_pathInfos[index]->inputport); if (portnames) { for (int i=0; portnames[i]; i++) { jack_disconnect (_jackClient, portnames[i], jack_port_name(_pathInfos[index]->inputport)); } free(portnames); } _pathInfos[index]->inconn_list.clear(); return true; } } return false; } bool FTjackSupport::disconnectPathOutput (int index, const char *outname) { if (!_jackClient) return false; if (index >=0 && index < FT_MAXPATHS && _pathInfos[index]) { if (outname) { if (jack_disconnect (_jackClient, jack_port_name(_pathInfos[index]->outputport), outname)) { fprintf (stderr, "cannot disconnect output ports\n"); return false; } _pathInfos[index]->outconn_list.remove (outname); return true; } else { // disconnect all from our output port const char ** portnames = jack_port_get_connections (_pathInfos[index]->outputport); if (portnames) { for (int i=0; portnames[i]; i++) { jack_disconnect (_jackClient, jack_port_name(_pathInfos[index]->outputport), portnames[i]); } free(portnames); } _pathInfos[index]->outconn_list.clear(); return true; } } return false; } const char ** FTjackSupport::getInputConnectablePorts (int index) { const char ** portnames = NULL; if (!_jackClient) return NULL; if (index >=0 && index < FT_MAXPATHS && _pathInfos[index]) { //char regexstr[100]; // anything but our own output port //snprintf(regexstr, 99, "^(%s)", jack_port_name (_pathInfos[index]->outputport) ); portnames = jack_get_ports( _jackClient, NULL, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput); } return portnames; } const char ** FTjackSupport::getOutputConnectablePorts (int index) { const char ** portnames = NULL; if (!_jackClient) return NULL; if (index >=0 && index < FT_MAXPATHS && _pathInfos[index]) { //char regexstr[100]; // anything but our own input port //snprintf(regexstr, 99, "^(%s)", jack_port_name (_pathInfos[index]->inputport) ); portnames = jack_get_ports( _jackClient, NULL, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput); } return portnames; } const char ** FTjackSupport::getConnectedInputPorts(int index) { const char ** portnames = NULL; if (!_jackClient) return NULL; if (index >=0 && index < FT_MAXPATHS && _pathInfos[index]) { //char regexstr[100]; // anything but our own input port //snprintf(regexstr, 99, "^(%s)", jack_port_name (_pathInfos[index]->inputport) ); portnames = jack_port_get_connections( _pathInfos[index]->inputport); _pathInfos[index]->inconn_list.clear(); if (portnames) { for (int i=0; portnames[i]; i++) { _pathInfos[index]->inconn_list.push_back (portnames[i]); } } } return portnames; } const char ** FTjackSupport::getConnectedOutputPorts(int index) { const char ** portnames = NULL; if (!_jackClient) return NULL; if (index >=0 && index < FT_MAXPATHS && _pathInfos[index]) { //char regexstr[100]; // anything but our own input port //snprintf(regexstr, 99, "^(%s)", jack_port_name (_pathInfos[index]->inputport) ); portnames = jack_port_get_connections( _pathInfos[index]->outputport); _pathInfos[index]->outconn_list.clear(); if (portnames) { for (int i=0; portnames[i]; i++) { _pathInfos[index]->outconn_list.push_back (portnames[i]); } } } return portnames; } const char ** FTjackSupport::getPhysicalInputPorts() { const char ** portnames = NULL; if (!_jackClient) return NULL; if ((portnames = jack_get_ports (_jackClient, NULL, NULL, JackPortIsPhysical|JackPortIsOutput)) == NULL) { fprintf(stderr, "Cannot find any physical capture ports"); } return portnames; } const char ** FTjackSupport::getPhysicalOutputPorts() { const char ** portnames = NULL; if (!_jackClient) return NULL; if ((portnames = jack_get_ports (_jackClient, NULL, NULL, JackPortIsPhysical|JackPortIsInput)) == NULL) { fprintf(stderr, "Cannot find any physical playback ports"); } return portnames; } nframes_t FTjackSupport::getTransportFrame() { if (!_jackClient) return 0; if (jack_transport_query (_jackClient, 0) == JackTransportRolling) { return jack_get_current_transport_frame (_jackClient); } else { return jack_frame_time (_jackClient); } } bool FTjackSupport::inAudioThread() { if (_jackClient && (pthread_self() == jack_client_thread_id (_jackClient))) { return true; } return false; } void FTjackSupport::setProcessingBypassed (bool val) { if (_bypassed != val) { // TODO: flag some sort of cross-fade ramp _bypassed = val; } } bool FTjackSupport::reinit (bool rebuild) { // assume that activePathCount is in the previous state // assume that the _pathInfos contain valid lists of connected ports // and active flags //printf ("reinit\n"); if (!_jackClient) return false; for (int i=0; i < FT_MAXPATHS; i++) { if (_pathInfos[i] && _pathInfos[i]->active) { if (rebuild) { _pathInfos[i]->active = false; setProcessPathActive (i, true); } // reconnect to ports list inlist (_pathInfos[i]->inconn_list); // copy _pathInfos[i]->inconn_list.clear(); for (list::iterator port = inlist.begin(); port != inlist.end(); ++port) { // only do it if the port is not one of ours // those interconnected ports within ourself are added // only once below jack_port_t * tport = jack_port_by_name(_jackClient, (*port).c_str()); if ( tport && ! jack_port_is_mine ( _jackClient, tport)) { //fprintf(stderr, "reconnecting to input: %s\n", port.c_str()); connectPathInput ( i, (*port).c_str() ); } } list outlist (_pathInfos[i]->outconn_list); // copy _pathInfos[i]->outconn_list.clear(); for (list::iterator port = outlist.begin(); port != outlist.end(); ++port) { //fprintf(stderr, "reconnecting to output: %s\n", port.c_str()); connectPathOutput ( i, (*port).c_str() ); } } } return true; } /** static callbacks **/ int FTjackSupport::processCallback (jack_nframes_t nframes, void *arg) { FTjackSupport * jsup = (FTjackSupport *) FTioSupport::instance(); PathInfo * tmppath; // do processing for each path for (int i=0; i < FT_MAXPATHS; i++) { if (jsup->_pathInfos[i] && jsup->_pathInfos[i]->active) { tmppath = jsup->_pathInfos[i]; sample_t *in = (sample_t *) jack_port_get_buffer (tmppath->inputport, nframes); sample_t *out = (sample_t *) jack_port_get_buffer (tmppath->outputport, nframes); if (jsup->_bypassed) { if (in != out) { memcpy (out, in, nframes * sizeof(sample_t)); } } else { tmppath->procpath->processData(in, out, nframes); } } } return 0; } int FTjackSupport::srateCallback (jack_nframes_t nframes, void *arg) { FTjackSupport * jsup = (FTjackSupport *) FTioSupport::instance(); for (int i=0; i < FT_MAXPATHS; i++) { if (jsup->_pathInfos[i]) { jsup->_pathInfos[i]->procpath->setSampleRate(nframes); } } return 0; } void FTjackSupport::jackShutdown (void *arg) { FTjackSupport * jsup = (FTjackSupport *) FTioSupport::instance(); fprintf (stderr, "Jack shut us down!\n"); jsup->_inited = false; jsup->_jackClient = 0; /* //jsup->close(); fprintf (stderr, "Trying to reconnect....\n"); if (jsup->init()) { if (jsup->startProcessing()) { jsup->reinit (); } } */ } // This isn't in use yet. int FTjackSupport::portsChanged (jack_port_id_t port, int blah, void *arg) { FTjackSupport * jsup = (FTjackSupport *) FTioSupport::instance(); fprintf (stderr, "Ports changed on us!\n"); jsup->_portsChanged = true; return 0; } freqtweak-0.7.2/src/FTjackSupport.hpp0000644000175200017520000000636411226173741016551 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ /** * Supports operations concerning I/O with JACK */ #ifndef __FTJACKSUPPORT_HPP__ #define __FTJACKSUPPORT_HPP__ #include #include "FTtypes.hpp" #include "FTioSupport.hpp" #include #include using namespace std; class FTprocessPath; class FTjackSupport : public FTioSupport { public: FTjackSupport(const char * name="", const char * dir=""); virtual ~FTjackSupport(); bool init(); bool reinit(bool rebuild=true); bool isInited() { return _inited; } //bool setProcessPath(FTprocessPath *ppath, int index); FTprocessPath * setProcessPathActive(int index, bool flag); FTprocessPath * getProcessPath(int index) { if(index >=0 && indexprocpath; return 0; } int getActivePathCount () { return _activePathCount; } bool startProcessing(); bool stopProcessing(); bool close(); bool connectPathInput (int index, const char *inname); bool connectPathOutput (int index, const char *outname); bool disconnectPathInput (int index, const char *inname); bool disconnectPathOutput (int index, const char *outname); const char ** getConnectedInputPorts(int index); const char ** getConnectedOutputPorts(int index); const char ** getInputConnectablePorts(int index); const char ** getOutputConnectablePorts(int index); const char ** getPhysicalInputPorts(); const char ** getPhysicalOutputPorts(); const char * getInputPortName(int index); const char * getOutputPortName(int index); bool inAudioThread(); nframes_t getSampleRate() { return _sampleRate; } nframes_t getTransportFrame(); bool getPortsChanged() { return _portsChanged; } void setProcessingBypassed (bool val); protected: // JACK callbacks are static static int processCallback (jack_nframes_t nframes, void *arg); static int srateCallback (jack_nframes_t nframes, void *arg); static void jackShutdown (void *arg); static int portsChanged (jack_port_id_t port, int blah, void *arg); bool _inited; jack_client_t * _jackClient; jack_nframes_t _sampleRate; jack_nframes_t _maxBufsize; struct PathInfo { FTprocessPath * procpath; jack_port_t * inputport; jack_port_t * outputport; bool active; list inconn_list; list outconn_list; }; // FIXME: use real data structure PathInfo* _pathInfos[FT_MAXPATHS]; int _activePathCount; //char _name[100]; string _jackserv; bool _portsChanged; bool _activated; bool _bypassed; }; #endif freqtweak-0.7.2/src/FTtypes.hpp0000644000175200017520000000370011226173741015377 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTTYPES_HPP__ #define __FTTYPES_HPP__ #include // these should match jack's types but we'll avoid the include // for now typedef float sample_t; typedef uint32_t nframes_t; typedef float fft_data; #define FT_MAXPATHS 4 #define FT_FIFOLENGTH (1 << 18) #define FT_MAX_FFT_SIZE 16384 #define FT_MAX_FFT_SIZE_HALF (FT_MAX_FFT_SIZE / 2) #define FT_MAX_AVERAGES 128 #define FT_MAX_OVERSAMP 16 enum SpecModType { ALL_SPECMOD = 0, FREQ_SPECMOD, DELAY_SPECMOD, FEEDB_SPECMOD, SCALE_SPECMOD, GATE_SPECMOD, SQUELCH_SPECMOD, MASH_SPECMOD, WARP_SPECMOD, EXPAND_SPECMOD, COMPRESS_SPECMOD, BOOST_SPECMOD, RESCUT_SPECMOD, RESCUTEQ_SPECMOD }; enum XScaleType { XSCALE_1X = 0, // 1:1 plot bin to filter bin XSCALE_2X, // ~ 2:1 " with last bin representing the entire upper half XSCALE_3X, // ~ 3:1 " with last 2 bins representing to upper thirds XSCALE_4X, // ~ 4:1 " with last 3 bins representing each upper 1/4 XSCALE_LOGA, // pseudo-log scale with lower freqs having bigger bins XSCALE_LOGB, // pseudo-log scale with lower freqs having bigger bins }; enum YScaleType { YSCALE_1X, // YSCALE_2X, // YSCALE_3X, // YSCALE_4X, // }; #endif freqtweak-0.7.2/src/FTspectralEngine.cpp0000644000175200017520000005055011226173741017176 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #if USING_FFTW3 #include #else #ifdef HAVE_SFFTW_H #include #else #include #endif #ifdef HAVE_SRFFTW_H #include #else #include #endif #endif #include #include #include #include #include #include "FTtypes.hpp" #include "FTspectralEngine.hpp" #include "FTprocessPath.hpp" #include "RingBuffer.hpp" #include "FTspectrumModifier.hpp" #include "FTioSupport.hpp" #include "FTupdateToken.hpp" #include "FTprocI.hpp" #include "FTmodulatorI.hpp" using namespace PBD; using namespace std; const int FTspectralEngine::_windowStringCount = 4; const char * FTspectralEngine::_windowStrings[] = { "Hanning", "Hamming", "Blackman", "Rectangle" }; const int FTspectralEngine::_fftSizeCount = 9; const int FTspectralEngine::_fftSizes[] = { 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192 }; // in samples (about 3 seconds at 44100) #define FT_MAX_DELAYSAMPLES (1 << 19) FTspectralEngine::FTspectralEngine() : _fftN (512), _windowing(FTspectralEngine::WINDOW_HANNING) , _oversamp(4), _averages(8), _fftnChanged(false) , _inputGain(1.0), _mixRatio(1.0), _bypassFlag(false), _mutedFlag(false), _updateSpeed(SPEED_MED) , _id(0), _updateToken(0), _maxDelay(2.5) , _currInAvgIndex(0), _currOutAvgIndex(0), _avgReady(false) { // one time allocations, why? because mysterious crash occurs when // when reallocating them _inputPowerSpectra = new fft_data [FT_MAX_FFT_SIZE_HALF]; _outputPowerSpectra = new fft_data [FT_MAX_FFT_SIZE_HALF]; memset((char *) _inputPowerSpectra, 0, FT_MAX_FFT_SIZE_HALF*sizeof(fft_data)); memset((char *) _outputPowerSpectra, 0, FT_MAX_FFT_SIZE_HALF*sizeof(fft_data)); _runningInputPower = new fft_data [FT_MAX_FFT_SIZE_HALF]; _runningOutputPower = new fft_data [FT_MAX_FFT_SIZE_HALF]; memset((char *) _runningOutputPower, 0, FT_MAX_FFT_SIZE_HALF*sizeof(fft_data)); memset((char *) _runningInputPower, 0, FT_MAX_FFT_SIZE_HALF*sizeof(fft_data)); initState(); } void FTspectralEngine::initState() { _inwork = new fft_data [_fftN]; _accum = new fft_data [2 * _fftN]; memset((char *) _accum, 0, 2*_fftN*sizeof(fft_data)); memset((char *) _inwork, 0, _fftN*sizeof(fft_data)); #if USING_FFTW3 _outwork = (fft_data *) fftwf_malloc(sizeof(fft_data) * _fftN); _winwork = (fft_data *) fftwf_malloc(sizeof(fft_data) * _fftN); _fftPlan = fftwf_plan_r2r_1d(_fftN, _winwork, _outwork, FFTW_R2HC, FFTW_ESTIMATE); _ifftPlan = fftwf_plan_r2r_1d(_fftN, _outwork, _winwork, FFTW_HC2R, FFTW_ESTIMATE); #else _outwork = new fft_data [_fftN]; _winwork = new fft_data [_fftN]; _fftPlan = rfftw_create_plan(_fftN, FFTW_REAL_TO_COMPLEX, FFTW_ESTIMATE); _ifftPlan = rfftw_create_plan(_fftN, FFTW_COMPLEX_TO_REAL, FFTW_ESTIMATE); #endif _sampleRate = FTioSupport::instance()->getSampleRate(); // window init createWindowVectors(); _averages = (int) (_oversamp * _updateSpeed * 512/(float)_fftN); // magic? if (_averages == 0) _averages = 1; // reset averages _currInAvgIndex = 0; _currOutAvgIndex = 0; _avgReady = false; for (vector::iterator iter = _procModules.begin(); iter != _procModules.end(); ++iter) { (*iter)->reset(); } } void FTspectralEngine::destroyState() { delete [] _inwork; delete [] _accum; // destroy window vectors for(int i = 0; i < NUM_WINDOWS; i++) { delete [] _mWindows[i]; } #if USING_FFTW3 fftwf_destroy_plan (_fftPlan); fftwf_destroy_plan (_ifftPlan); fftwf_free (_winwork); fftwf_free (_outwork); #else rfftw_destroy_plan (_fftPlan); rfftw_destroy_plan (_ifftPlan); delete [] _outwork; delete [] _winwork; #endif } FTspectralEngine::~FTspectralEngine() { destroyState(); delete [] _inputPowerSpectra; delete [] _outputPowerSpectra; delete [] _runningInputPower; delete [] _runningOutputPower; for (vector::iterator iter = _procModules.begin(); iter != _procModules.end(); ++iter) { delete (*iter); } } void FTspectralEngine::getProcessorModules (vector & modules) { modules.clear(); LockMonitor pmlock(_procmodLock, __LINE__, __FILE__); modules.insert (modules.begin(), _procModules.begin(), _procModules.end()); } FTprocI * FTspectralEngine::getProcessorModule ( unsigned int num) { LockMonitor (_procmodLock, __LINE__, __FILE__); if (num < _procModules.size()) { return _procModules[num]; } return 0; } void FTspectralEngine::insertProcessorModule (FTprocI * procmod, unsigned int index) { if (!procmod) return; LockMonitor pmlock(_procmodLock, __LINE__, __FILE__); vector::iterator iter = _procModules.begin(); for (unsigned int n=0; n < index && iter!=_procModules.end(); ++n) { ++iter; } procmod->setOversamp (_oversamp); procmod->setFFTsize (_fftN); procmod->setSampleRate (_sampleRate); _procModules.insert (iter, procmod); } void FTspectralEngine::appendProcessorModule (FTprocI * procmod) { if (!procmod) return; LockMonitor (_procmodLock, __LINE__, __FILE__); procmod->setOversamp (_oversamp); procmod->setFFTsize (_fftN); procmod->setSampleRate (_sampleRate); _procModules.push_back (procmod); } void FTspectralEngine::moveProcessorModule (unsigned int from, unsigned int to) { // both indexes refer to current positions within the list LockMonitor pmlock(_procmodLock, __LINE__, __FILE__); vector::iterator iter = _procModules.begin(); for (unsigned int n=0; n < from && iter!=_procModules.end(); ++n) { ++iter; } if (iter == _procModules.end()) return; // remove from FTprocI * fproc = (*iter); _procModules.erase (iter); iter = _procModules.begin(); if (to >= from) { // need to go one less for (unsigned int n=0; n < to && iter!=_procModules.end(); ++n) { ++iter; } } else { for (unsigned int n=0; n < to && iter!=_procModules.end(); ++n) { ++iter; } } _procModules.insert (iter, fproc); } void FTspectralEngine::removeProcessorModule (unsigned int index, bool destroy) { LockMonitor pmlock(_procmodLock, __LINE__, __FILE__); if (index >= _procModules.size()) return; vector::iterator iter = _procModules.begin(); for (unsigned int n=0; n < index && iter!=_procModules.end(); ++n) { ++iter; } if (iter == _procModules.end()) return; if (destroy) { FTprocI * proc = (*iter); delete proc; } _procModules.erase(iter); } void FTspectralEngine::clearProcessorModules (bool destroy) { LockMonitor pmlock(_procmodLock, __LINE__, __FILE__); vector::iterator iter = _procModules.begin(); if (destroy) { for (; iter != _procModules.end(); ++iter) { delete (*iter); } } _procModules.clear(); } void FTspectralEngine::getModulators (vector & modules) { modules.clear(); LockMonitor pmlock(_modulatorLock, __LINE__, __FILE__); modules.insert (modules.begin(), _modulators.begin(), _modulators.end()); } FTmodulatorI * FTspectralEngine::getModulator ( unsigned int num) { LockMonitor (_modulatorLock, __LINE__, __FILE__); if (num < _modulators.size()) { return _modulators[num]; } return 0; } void FTspectralEngine::insertModulator (FTmodulatorI * procmod, unsigned int index) { if (!procmod) return; { LockMonitor pmlock(_modulatorLock, __LINE__, __FILE__); vector::iterator iter = _modulators.begin(); for (unsigned int n=0; n < index && iter!=_modulators.end(); ++n) { ++iter; } procmod->setFFTsize (_fftN); procmod->setSampleRate (_sampleRate); _modulators.insert (iter, procmod); } ModulatorAdded (procmod); // emit } void FTspectralEngine::appendModulator (FTmodulatorI * procmod) { if (!procmod) return; { LockMonitor (_modulatorLock, __LINE__, __FILE__); procmod->setFFTsize (_fftN); procmod->setSampleRate (_sampleRate); _modulators.push_back (procmod); } ModulatorAdded (procmod); // emit } void FTspectralEngine::moveModulator (unsigned int from, unsigned int to) { // both indexes refer to current positions within the list LockMonitor pmlock(_modulatorLock, __LINE__, __FILE__); vector::iterator iter = _modulators.begin(); for (unsigned int n=0; n < from && iter!=_modulators.end(); ++n) { ++iter; } if (iter == _modulators.end()) return; // remove from FTmodulatorI * fproc = (*iter); _modulators.erase (iter); iter = _modulators.begin(); if (to >= from) { // need to go one less for (unsigned int n=0; n < to && iter!=_modulators.end(); ++n) { ++iter; } } else { for (unsigned int n=0; n < to && iter!=_modulators.end(); ++n) { ++iter; } } _modulators.insert (iter, fproc); } void FTspectralEngine::removeModulator (unsigned int index, bool destroy) { LockMonitor pmlock(_modulatorLock, __LINE__, __FILE__); if (index >= _modulators.size()) return; vector::iterator iter = _modulators.begin(); for (unsigned int n=0; n < index && iter!=_modulators.end(); ++n) { ++iter; } if (iter == _modulators.end()) return; if (destroy) { FTmodulatorI * proc = (*iter); delete proc; } _modulators.erase(iter); } void FTspectralEngine::removeModulator (FTmodulatorI * procmod, bool destroy) { bool candel = false; { LockMonitor pmlock(_modulatorLock, __LINE__, __FILE__); for (vector::iterator iter = _modulators.begin(); iter != _modulators.end(); ++iter) { if (procmod == *iter) { _modulators.erase(iter); candel = true; break; } } } if (destroy && candel) { delete procmod; } } bool FTspectralEngine::hasModulator (FTmodulatorI * procmod) { LockMonitor pmlock(_modulatorLock, __LINE__, __FILE__); return (find(_modulators.begin(), _modulators.end(), procmod) != _modulators.end()); } void FTspectralEngine::clearModulators (bool destroy) { LockMonitor pmlock(_modulatorLock, __LINE__, __FILE__); vector::iterator iter = _modulators.begin(); if (destroy) { for (; iter != _modulators.end(); ++iter) { delete (*iter); } } _modulators.clear(); } void FTspectralEngine::setId (int id) { LockMonitor pmlock(_procmodLock, __LINE__, __FILE__); _id = id; // set the id of all our filters for (vector::iterator iter = _procModules.begin(); iter != _procModules.end(); ++iter) { (*iter)->setId (id); } } void FTspectralEngine::setFFTsize (FTspectralEngine::FFT_Size sz) { // THIS MUST NOT BE CALLED WHILE WE ARE ACTIVATED! //LockMonitor pmlock(_fftLock, __LINE__, __FILE__); if ((int) sz != _fftN) { _fftN = sz; // change these first for (vector::iterator iter = _procModules.begin(); iter != _procModules.end(); ++iter) { (*iter)->setFFTsize (_fftN); } destroyState(); initState(); } } void FTspectralEngine::setOversamp (int osamp) { _oversamp = osamp; _averages = (int) (_oversamp * (float) _updateSpeed * 512/(float)_fftN); // magic? if (_averages == 0) _averages = 1; // reset averages memset(_runningOutputPower, 0, _fftN * sizeof(float)); memset(_runningInputPower, 0, _fftN * sizeof(float)); _currInAvgIndex = 0; _currOutAvgIndex = 0; _avgReady = false; LockMonitor pmlock(_procmodLock, __LINE__, __FILE__); // set it in all the modules for (vector::iterator iter = _procModules.begin(); iter != _procModules.end(); ++iter) { (*iter)->setOversamp (_oversamp); } } void FTspectralEngine::setUpdateSpeed (UpdateSpeed speed) { _updateSpeed = speed; _averages = (int) (_oversamp * (float) _updateSpeed * 512/(float)_fftN); // magic? if (_averages == 0) _averages = 1; // reset averages memset(_runningOutputPower, 0, _fftN * sizeof(float)); memset(_runningInputPower, 0, _fftN * sizeof(float)); _currInAvgIndex = 0; _currOutAvgIndex = 0; _avgReady = false; } void FTspectralEngine::setMaxDelay(float secs) { // THIS MUST NOT BE CALLED WHILE WE ARE ACTIVATED! if (secs <= 0.0) return; LockMonitor pmlock(_procmodLock, __LINE__, __FILE__); _maxDelay = secs; for (vector::iterator iter = _procModules.begin(); iter != _procModules.end(); ++iter) { (*iter)->setMaxDelay (secs); } } nframes_t FTspectralEngine::getLatency() { int step_size = _fftN / _oversamp; int latency = _fftN - step_size; return latency; } /** * Main FFT processing done here * this is called from the i/o thread */ bool FTspectralEngine::processNow (FTprocessPath *procpath) { int i; int osamp = _oversamp; int step_size = _fftN / osamp; int latency = _fftN - step_size; float * win = _mWindows[_windowing]; nframes_t current_frame = FTioSupport::instance()->getTransportFrame(); // do we have enough data for next frame (oversampled)? while (procpath->getInputFifo()->read_space() >= (step_size * sizeof(sample_t))) { //printf ("processing spectral sizeof sample = %d fft_data = %d\n", sizeof(sample_t), sizeof(fftw_real)); // copy data into fft work buf procpath->getInputFifo()->read ( (char *) (&_inwork[latency]), step_size * sizeof(sample_t) ); //printf ("real data 1 = %g\n", _inwork[1]); // window data into winwork for(i = 0; i < _fftN; i++) { _winwork[i] = _inwork[i] * win[i] * _inputGain; } #if USING_FFTW3 // do forward real FFT fftwf_execute(_fftPlan); #else // do forward real FFT rfftw_one(_fftPlan, _winwork, _outwork); #endif // compute running mag^2 buffer for input computeAverageInputPower (_outwork); // do modulation in order with each modulator { TentativeLockMonitor modlock(_modulatorLock, __LINE__, __FILE__); if (modlock.locked()) { for (vector::iterator iter = _modulators.begin(); iter != _modulators.end(); ++iter) { (*iter)->modulate (current_frame, _outwork, _fftN, _inwork, _fftN); } } } // do processing in order with each processing module { TentativeLockMonitor pmlock(_procmodLock, __LINE__, __FILE__); if (pmlock.locked()) { for (vector::iterator iter = _procModules.begin(); iter != _procModules.end(); ++iter) { // do it in place (*iter)->process (_outwork, _fftN); } } } // compute running mag^2 buffer for output computeAverageOutputPower (_outwork); #if USING_FFTW3 // do reverse FFT fftwf_execute(_ifftPlan); #else // do reverse FFT rfftw_one(_ifftPlan, _outwork, _winwork); #endif // the output is scaled by fftN, we need to normalize it and window it for ( i=0; i < _fftN; i++) { _accum[i] += _mixRatio * 4.0f * win[i] * _winwork[i] / ((float)_fftN * osamp); } // mix in dry only if necessary if (_mixRatio < 1.0) { float dry = 1.0 - _mixRatio; for (i=0; i < step_size; i++) { _accum[i] += dry * _inwork[i] ; } } // put step_size worth of the real data into the processPath out buffer procpath->getOutputFifo()->write( (char *)_accum, sizeof(sample_t) * step_size); // shift output accumulator data memmove(_accum, _accum + step_size, _fftN*sizeof(sample_t)); // shift input fifo (inwork) memmove(_inwork, _inwork + step_size, latency*sizeof(sample_t)); // update events for those who listen if (_avgReady && _updateToken) { _updateToken->setUpdated(true); _avgReady = false; } current_frame += step_size; } return true; } void FTspectralEngine::computeAverageInputPower (fft_data *fftbuf) { int fftn2 = _fftN / 2; if (_averages > 1) { if (_currInAvgIndex > 0) { _inputPowerSpectra[0] += fftbuf[0] * fftbuf[0]; for (int i=1; i < fftn2-1; i++) { _inputPowerSpectra[i] += (fftbuf[i] * fftbuf[i]) + (fftbuf[_fftN-i] * fftbuf[_fftN-i]); } } else { _inputPowerSpectra[0] = fftbuf[0] * fftbuf[0]; for (int i=1; i < fftn2-1 ; i++) { _inputPowerSpectra[i] = (fftbuf[i] * fftbuf[i]) + (fftbuf[_fftN-i] * fftbuf[_fftN-i]); } } _currInAvgIndex = (_currInAvgIndex+1) % _averages; if (_currInAvgIndex == 0) { _runningInputPower[0] = _inputPowerSpectra[0] / _averages; for (int i=1; i < fftn2-1 ; i++) { _runningInputPower[i] = _inputPowerSpectra[i] / _averages; } _avgReady = true; } } else { // 1 average, minimize looping _runningInputPower[0] = (fftbuf[0] * fftbuf[0]); for (int i=1; i < fftn2-1 ; i++) { _runningInputPower[i] = (fftbuf[i] * fftbuf[i]) + (fftbuf[_fftN-i] * fftbuf[_fftN-i]); } _avgReady = true; } } void FTspectralEngine::computeAverageOutputPower (fft_data *fftbuf) { int fftn2 = (_fftN+1) / 2; if (_averages > 1) { if (_currOutAvgIndex > 0) { _outputPowerSpectra[0] += (fftbuf[0] * fftbuf[0]); for (int i=1; i < fftn2-1; i++) { _outputPowerSpectra[i] += (fftbuf[i] * fftbuf[i]) + (fftbuf[_fftN-i] * fftbuf[_fftN-i]); } } else { _outputPowerSpectra[0] = (fftbuf[0] * fftbuf[0]); for (int i=1; i < fftn2-1 ; i++) { _outputPowerSpectra[i] = (fftbuf[i] * fftbuf[i]) + (fftbuf[_fftN-i] * fftbuf[_fftN-i]); } } _currOutAvgIndex = (_currOutAvgIndex+1) % _averages; if (_currOutAvgIndex == 0) { _runningOutputPower[0] = _outputPowerSpectra[0] / _averages; for (int i=1; i < fftn2-1 ; i++) { _runningOutputPower[i] = _outputPowerSpectra[i] / _averages; } _avgReady = true; } } else { // 1 average, minimize looping _runningOutputPower[0] = (fftbuf[0] * fftbuf[0]); for (int i=1; i < fftn2-1 ; i++) { _runningOutputPower[i] = (fftbuf[i] * fftbuf[i]) + (fftbuf[_fftN-i] * fftbuf[_fftN-i]); } _avgReady = true; } } void FTspectralEngine::createWindowVectors (bool noalloc) { /////////////////////////////////////////////////////////////////////////// int i; /////////////////////////////////////////////////////////////////////////// if (!noalloc) { /////////////////////////////////////////////////////////////////////////// // create window array _mWindows = new float*[NUM_WINDOWS]; /////////////////////////////////////////////////////////////////////////// // allocate vectors for(i = 0; i < NUM_WINDOWS; i++) { _mWindows[i] = new float[_fftN]; } } /////////////////////////////////////////////////////////////////////////// // create windows createRectangleWindow (); createHanningWindow (); createHammingWindow (); createBlackmanWindow (); } void FTspectralEngine::createRectangleWindow () { /////////////////////////////////////////////////////////////////////////// int i; /////////////////////////////////////////////////////////////////////////// for(i = 0; i < _fftN; i++) { _mWindows[WINDOW_RECTANGLE][i] = 0.5; } } void FTspectralEngine::createHanningWindow () { /////////////////////////////////////////////////////////////////////////// int i; /////////////////////////////////////////////////////////////////////////// for(i = 0; i < _fftN; i++) { _mWindows[WINDOW_HANNING][i] = 0.81 * ( // fudge factor 0.5 - (0.5 * //(float) cos(2.0 * M_PI * i / (_fftN - 1.0))); (float) cos(2.0 * M_PI * i / (_fftN)))); } } void FTspectralEngine::createHammingWindow () { /////////////////////////////////////////////////////////////////////////// int i; /////////////////////////////////////////////////////////////////////////// for(i = 0; i < _fftN; i++) { _mWindows[WINDOW_HAMMING][i] = 0.82 * ( // fudge factor 0.54 - (0.46 * (float) cos(2.0 * M_PI * i / (_fftN - 1.0)))); } } void FTspectralEngine::createBlackmanWindow () { /////////////////////////////////////////////////////////////////////////// int i; /////////////////////////////////////////////////////////////////////////// for(i = 0; i < _fftN; i++) { _mWindows[WINDOW_BLACKMAN][i] = 0.9 * ( // fudge factor 0.42 - (0.50 * (float) cos( 2.0 * M_PI * i /(_fftN - 1.0))) + (0.08 * (float) cos( 4.0 * M_PI * i /(_fftN - 1.0)))); } } freqtweak-0.7.2/src/FTspectralEngine.hpp0000644000175200017520000001465611226173741017212 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTSPECTRALENGINE_HPP__ #define __FTSPECTRALENGINE_HPP__ #if HAVE_CONFIG_H #include #endif #if USING_FFTW3 #include #else #ifdef HAVE_SRFFTW_H #include #else #include #endif #endif #include "FTutils.hpp" #include "FTtypes.hpp" #include "LockMonitor.hpp" #include #include using namespace std; class FTprocessPath; class RingBuffer; class FTspectrumModifier; class FTupdateToken; class FTmodulatorI; class FTprocI; class FTspectralEngine { public: FTspectralEngine(); virtual ~FTspectralEngine(); bool processNow (FTprocessPath *procpath); enum FFT_Size { FFT_32 = 32, FFT_64 = 64, FFT_128 = 128, FFT_256 = 256, FFT_512 = 512, FFT_1024 = 1024, FFT_2048 = 2048, FFT_4096 = 4096, FFT_8192 = 8192 }; enum Windowing { WINDOW_HANNING = 0, WINDOW_HAMMING, WINDOW_BLACKMAN, WINDOW_RECTANGLE }; enum UpdateSpeed { SPEED_FAST = 1, SPEED_MED = 2, SPEED_SLOW = 4, SPEED_TURTLE = 8, }; static const int NUM_WINDOWS = 5; void setId (int id); int getId () { return _id; } void setUpdateToken (FTupdateToken *tok) { _updateToken = tok; } FTupdateToken * getUpdateToken() { return _updateToken; } void setFFTsize (FFT_Size sz); // ONLY call when not processing FFT_Size getFFTsize() { return (FFT_Size) _fftN; } void setSampleRate (nframes_t rate) { _sampleRate = rate; } nframes_t getSampleRate() { return _sampleRate; } void setWindowing (Windowing w) { _windowing = w; } Windowing getWindowing() { return _windowing; } void setAverages (int avg) { if (avg > _maxAverages) _averages = _maxAverages; _averages = avg; } int getAverages () { return _averages; } void setOversamp (int osamp); int getOversamp () { return _oversamp; } void setUpdateSpeed (UpdateSpeed speed); UpdateSpeed getUpdateSpeed () { return _updateSpeed; } void setInputGain (float gain) { _inputGain = gain; } float getInputGain () { return _inputGain; } // 1.0 is fully wet void setMixRatio (float ratio) { _mixRatio = ratio; } float getMixRatio () { return _mixRatio;} void setBypassed (bool flag) { _bypassFlag = flag; } bool getBypassed () { return _bypassFlag; } void setMuted (bool flag) { _mutedFlag = flag; } bool getMuted () { return _mutedFlag; } float getMaxDelay () { return _maxDelay; } void setMaxDelay (float secs); // ONLY call when not processing void setTempo (int tempo) { _tempo = tempo; } int getTempo() { return _tempo; } const float * getRunningInputPower() { return _runningInputPower; } const float * getRunningOutputPower() { return _runningOutputPower; } nframes_t getLatency(); // processor module handling void insertProcessorModule (FTprocI * procmod, unsigned int index); void appendProcessorModule (FTprocI * procmod); void moveProcessorModule (unsigned int from, unsigned int to); void removeProcessorModule (unsigned int index, bool destroy=true); void clearProcessorModules (bool destroy=true); void getProcessorModules (vector & modules); FTprocI * getProcessorModule ( unsigned int num); // modulator handling void insertModulator (FTmodulatorI * procmod, unsigned int index); void appendModulator (FTmodulatorI * procmod); void moveModulator (unsigned int from, unsigned int to); void removeModulator (unsigned int index, bool destroy=true); void removeModulator (FTmodulatorI * procmod, bool destroy=true); void clearModulators (bool destroy=true); void getModulators (vector & modules); FTmodulatorI * getModulator ( unsigned int num); bool hasModulator (FTmodulatorI * procmod); SigC::Signal1 ModulatorAdded; static const char ** getWindowStrings() { return (const char **) _windowStrings; } static const int getWindowStringsCount() { return _windowStringCount; } static const int * getFFTSizes() { return (const int *) _fftSizes; } static const int getFFTSizeCount() { return _fftSizeCount; } protected: void computeAverageInputPower (fft_data *fftbuf); void computeAverageOutputPower (fft_data *fftbuf); void createWindowVectors(bool noalloc=false); void createRaisedCosineWindow(); void createRectangleWindow(); void createHanningWindow(); void createHammingWindow(); void createBlackmanWindow(); void initState(); void destroyState(); static const int _windowStringCount; static const char * _windowStrings[]; static const int _fftSizeCount; static const int _fftSizes[]; // the processing modules vector _procModules; PBD::NonBlockingLock _procmodLock; // the modulators vector _modulators; PBD::NonBlockingLock _modulatorLock; // fft size (thus frame length) int _fftN; Windowing _windowing; int _oversamp; int _maxAverages; int _averages; #ifdef USING_FFTW3 fftwf_plan _fftPlan; fftwf_plan _ifftPlan; #else rfftw_plan _fftPlan; // forward fft rfftw_plan _ifftPlan; // inverse fft #endif int _newfftN; bool _fftnChanged; PBD::NonBlockingLock _fftLock; // space for average input power buffer // elements = _fftN/2 * MAX_AVERAGES * MAX_OVERSAMP fft_data * _inputPowerSpectra; fft_data * _outputPowerSpectra; // the current running avg power // elements = _fftN/2 fft_data * _runningInputPower; fft_data * _runningOutputPower; nframes_t _sampleRate; float _inputGain; float _mixRatio; bool _bypassFlag; bool _mutedFlag; UpdateSpeed _updateSpeed; int _id; FTupdateToken * _updateToken; int _tempo; float _maxDelay; private: fft_data *_inwork, *_outwork; fft_data *_winwork; fft_data *_accum; fft_data *_scaletemp; // for windowing float ** _mWindows; // for averaging int _currInAvgIndex; int _currOutAvgIndex; bool _avgReady; }; #endif freqtweak-0.7.2/src/pix_button.cpp0000644000175200017520000001520711226173741016174 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include #include #include "pix_button.hpp" enum { ID_EditMenuOp = 9000, ID_DefaultMenuOp, ID_BindMenuOp }; using namespace JLCui; using namespace std; BEGIN_EVENT_TABLE(PixButton, wxWindow) EVT_SIZE(PixButton::OnSize) EVT_PAINT(PixButton::OnPaint) EVT_MOUSE_EVENTS(PixButton::OnMouseEvents) EVT_MENU (ID_BindMenuOp , PixButton::on_menu_events) END_EVENT_TABLE() PixButton::PixButton(wxWindow * parent, wxWindowID id, bool bindable, const wxPoint& pos, const wxSize& size) : wxWindow(parent, id, pos, size) { _bgcolor = *wxBLACK; _bgbrush.SetColour (_bgcolor); _bstate = Normal; _estate = Outside; _backing_store = 0; _active = false; if (bindable) { _popup_menu = new wxMenu(wxT("")); //_popup_menu->Append ( new wxMenuItem(_popup_menu, ID_EditMenuOp, wxT("Edit"))); //_popup_menu->Append ( new wxMenuItem(_popup_menu, ID_DefaultMenuOp, wxT("Set to default"))); //_popup_menu->AppendSeparator(); _popup_menu->Append ( new wxMenuItem(_popup_menu, ID_BindMenuOp, wxT("Learn MIDI Binding"))); } else { _popup_menu = 0; } SetBackgroundColour (_bgcolor); SetThemeEnabled(false); update_size(); } PixButton::~PixButton() { _memdc.SelectObject(wxNullBitmap); if (_backing_store) { delete _backing_store; } } void PixButton::set_normal_bitmap (const wxBitmap & bm) { if (!bm.Ok()) return; _normal_bitmap = bm; SetSizeHints (bm.GetWidth(), bm.GetHeight()); SetClientSize (bm.GetWidth(), bm.GetHeight()); Refresh(false); } void PixButton::set_focus_bitmap (const wxBitmap & bm) { if (!bm.Ok()) return; _focus_bitmap = bm; SetSizeHints (bm.GetWidth(), bm.GetHeight()); SetClientSize (bm.GetWidth(), bm.GetHeight()); Refresh(false); } void PixButton::set_selected_bitmap (const wxBitmap & bm) { if (!bm.Ok()) return; _selected_bitmap = bm; SetSizeHints (bm.GetWidth(), bm.GetHeight()); SetClientSize (bm.GetWidth(), bm.GetHeight()); Refresh(false); } void PixButton::set_disabled_bitmap (const wxBitmap & bm) { if (!bm.Ok()) return; _disabled_bitmap = bm; SetSizeHints (bm.GetWidth(), bm.GetHeight()); SetClientSize (bm.GetWidth(), bm.GetHeight()); Refresh(false); } void PixButton::set_active_bitmap (const wxBitmap & bm) { if (!bm.Ok()) return; _active_bitmap = bm; SetSizeHints (bm.GetWidth(), bm.GetHeight()); SetClientSize (bm.GetWidth(), bm.GetHeight()); Refresh(false); } void PixButton::set_bg_color (const wxColour & col) { _bgcolor = col; _bgbrush.SetColour (col); SetBackgroundColour (col); Refresh(false); } void PixButton::set_active(bool flag) { if (_active != flag) { _active = flag; Refresh(false); } } void PixButton::update_size() { GetClientSize(&_width, &_height); if (_width > 0 && _height > 0) { _memdc.SelectObject (wxNullBitmap); if (_backing_store) { delete _backing_store; } _backing_store = new wxBitmap(_width, _height); _memdc.SelectObject(*_backing_store); } } void PixButton::OnSize(wxSizeEvent & event) { update_size(); event.Skip(); } void PixButton::OnPaint(wxPaintEvent & event) { wxPaintDC pdc(this); if (!_backing_store) { return; } draw_area(_memdc); pdc.Blit(0, 0, _width, _height, &_memdc, 0, 0); } static inline int get_mouse_up_button(const wxMouseEvent &ev) { if (ev.LeftUp()) return (int) PixButton::LeftButton; else if (ev.MiddleUp()) return (int) PixButton::MiddleButton; else if (ev.RightUp()) return (int) PixButton::RightButton; else return 0; } static inline int get_mouse_button(const wxMouseEvent &ev) { if (ev.ButtonDown()) { if (ev.LeftDown()) return (int) PixButton::LeftButton; else if (ev.MiddleDown()) return (int) PixButton::MiddleButton; else if (ev.RightDown()) return (int) PixButton::RightButton; else return 0; } else if (ev.ButtonUp()) { if (ev.LeftUp()) return (int) PixButton::LeftButton; else if (ev.MiddleUp()) return (int) PixButton::MiddleButton; else if (ev.RightUp()) return (int) PixButton::RightButton; else return 0; } else return 0; } void PixButton::OnMouseEvents (wxMouseEvent &ev) { if (!IsEnabled()) { ev.Skip(); return; } if (ev.Moving()) { // do nothing } else if (ev.RightDown()) { if (_popup_menu) { this->PopupMenu ( _popup_menu, ev.GetX(), ev.GetY()); } else { pressed (get_mouse_button(ev)); // emit } } else if (ev.RightUp()) { //this->PopupMenu ( _popup_menu, ev.GetX(), ev.GetY()); released (get_mouse_button(ev)); // emit } else if (ev.ButtonDown()) { if (!(ev.MiddleDown() && ev.ControlDown())) { _bstate = Selected; pressed (get_mouse_button(ev)); // emit CaptureMouse(); Refresh(false); } } else if (ev.ButtonUp()) { _bstate = Normal; ReleaseMouse(); released (get_mouse_button(ev)); // emit wxPoint pt = ev.GetPosition(); wxRect bounds = GetRect(); pt.x += bounds.x; pt.y += bounds.y; if (bounds.Inside(pt)) { clicked (get_mouse_button(ev)); // emit if (ev.MiddleUp() && ev.ControlDown()) { bind_request(); // emit } } Refresh(false); } else if (ev.ButtonDClick()) { _bstate = Selected; pressed (get_mouse_button(ev)); // emit Refresh(false); } else if (ev.Entering()) { _estate = Inside; enter(); // emit Refresh(false); } else if (ev.Leaving()) { _estate = Outside; leave(); // emit Refresh(false); } ev.Skip(); } void PixButton::on_menu_events (wxCommandEvent &ev) { if (ev.GetId() == ID_BindMenuOp) { bind_request(); // emit } } void PixButton::draw_area(wxDC & dc) { dc.SetBackground(_bgbrush); dc.Clear(); if (!IsEnabled()) { dc.DrawBitmap (_disabled_bitmap, 0, 0); } else if (_active) { dc.DrawBitmap (_active_bitmap, 0, 0); } else { switch (_bstate) { case Normal: if (_estate == Outside) { dc.DrawBitmap (_normal_bitmap, 0, 0); } else { dc.DrawBitmap (_focus_bitmap, 0, 0); } break; case Selected: dc.DrawBitmap (_selected_bitmap, 0, 0); break; case Disabled: dc.DrawBitmap (_disabled_bitmap, 0, 0); break; } } } freqtweak-0.7.2/src/pix_button.hpp0000644000175200017520000000563711226173741016207 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __sooperlooper_gui_pix_button__ #define __sooperlooper_gui_pix_button__ #include #include namespace JLCui { class PixButton : public wxWindow { public: // ctor(s) PixButton(wxWindow * parent, wxWindowID id=-1, bool midibindable=true, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize); virtual ~PixButton(); void set_normal_bitmap (const wxBitmap & bm); void set_focus_bitmap (const wxBitmap & bm); void set_selected_bitmap (const wxBitmap & bm); void set_disabled_bitmap (const wxBitmap & bm); void set_active_bitmap (const wxBitmap & bm); wxBitmap & get_normal_bitmap() { return _normal_bitmap;} wxBitmap & get_focus_bitmap() { return _focus_bitmap; } wxBitmap & get_selected_bitmap() { return _selected_bitmap; } wxBitmap & get_disabled_bitmap() { return _disabled_bitmap; } wxBitmap & get_active_bitmap() { return _active_bitmap; } void set_active(bool flag); bool get_active() { return _active; } void set_bg_color (const wxColour & col); wxColour & get_bg_color () { return _bgcolor; } enum MouseButton { LeftButton=1, MiddleButton, RightButton }; // int argument is mouse button as above SigC::Signal1 pressed; SigC::Signal1 released; SigC::Signal1 clicked; SigC::Signal0 enter; SigC::Signal0 leave; SigC::Signal0 bind_request; protected: enum ButtonState { Normal, Selected, Disabled }; enum EnterState { Inside, Outside }; void OnPaint (wxPaintEvent &ev); void OnSize (wxSizeEvent &ev); void OnMouseEvents (wxMouseEvent &ev); void on_menu_events (wxCommandEvent &ev); void draw_area (wxDC & dc); void update_size(); wxBitmap _normal_bitmap; wxBitmap _focus_bitmap; wxBitmap _selected_bitmap; wxBitmap _disabled_bitmap; wxBitmap _active_bitmap; ButtonState _bstate; EnterState _estate; bool _active; int _width, _height; wxColour _bgcolor; wxBrush _bgbrush; wxBitmap * _backing_store; wxMemoryDC _memdc; wxMenu * _popup_menu; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; }; #endif freqtweak-0.7.2/src/cycles.h0000644000175200017520000001265111226173741014730 0ustar develdevel/* Copyright (C) 2001 Paul Davis Code derived from various headers from the Linux kernel This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. $Id: cycles.h,v 1.1 2004/04/13 01:17:54 essej Exp $ */ #ifndef __ardour_cycles_h__ #define __ardour_cycles_h__ #if defined(__i386__) || defined(__x86_64__) /* * Standard way to access the cycle counter on i586+ CPUs. * Currently only used on SMP. * * If you really have a SMP machine with i486 chips or older, * compile for that, and this will just always return zero. * That's ok, it just means that the nicer scheduling heuristics * won't work for you. * * We only use the low 32 bits, and we'd simply better make sure * that we reschedule before that wraps. Scheduling at least every * four billion cycles just basically sounds like a good idea, * regardless of how fast the machine is. */ typedef unsigned long long cycles_t; extern cycles_t cacheflush_time; #define rdtscll(val) \ __asm__ __volatile__("rdtsc" : "=A" (val)) static inline cycles_t get_cycles (void) { unsigned long long ret; rdtscll(ret); return ret; } #elif defined(__powerpc__) #define CPU_FTR_601 0x00000100 typedef unsigned long cycles_t; /* * For the "cycle" counter we use the timebase lower half. * Currently only used on SMP. */ extern cycles_t cacheflush_time; static inline cycles_t get_cycles(void) { cycles_t ret = 0; __asm__ __volatile__( "98: mftb %0\n" "99:\n" ".section __ftr_fixup,\"a\"\n" " .long %1\n" " .long 0\n" " .long 98b\n" " .long 99b\n" ".previous" : "=r" (ret) : "i" (CPU_FTR_601)); return ret; } #elif defined(__ia64__) /* ia64 */ typedef unsigned long cycles_t; static inline cycles_t get_cycles (void) { cycles_t ret; __asm__ __volatile__ ("mov %0=ar.itc" : "=r"(ret)); return ret; } #elif defined(__alpha__) /* alpha */ /* * Standard way to access the cycle counter. * Currently only used on SMP for scheduling. * * Only the low 32 bits are available as a continuously counting entity. * But this only means we'll force a reschedule every 8 seconds or so, * which isn't an evil thing. */ typedef unsigned int cycles_t; static inline cycles_t get_cycles (void) { cycles_t ret; __asm__ __volatile__ ("rpcc %0" : "=r"(ret)); return ret; } #elif defined(__s390__) /* s390 */ typedef unsigned long long cycles_t; static inline cycles_t get_cycles(void) { cycles_t cycles; __asm__("stck 0(%0)" : : "a" (&(cycles)) : "memory", "cc"); return cycles >> 2; } #elif defined(__hppa__) /* hppa/parisc */ #define mfctl(reg) ({ \ unsigned long cr; \ __asm__ __volatile__( \ "mfctl " #reg ",%0" : \ "=r" (cr) \ ); \ cr; \ }) typedef unsigned long cycles_t; static inline cycles_t get_cycles (void) { return mfctl(16); } #elif defined(__mips__) /* mips/mipsel */ /* * Standard way to access the cycle counter. * Currently only used on SMP for scheduling. * * Only the low 32 bits are available as a continuously counting entity. * But this only means we'll force a reschedule every 8 seconds or so, * which isn't an evil thing. * * We know that all SMP capable CPUs have cycle counters. */ #define __read_32bit_c0_register(source, sel) \ ({ int __res; \ if (sel == 0) \ __asm__ __volatile__( \ "mfc0\t%0, " #source "\n\t" \ : "=r" (__res)); \ else \ __asm__ __volatile__( \ ".set\tmips32\n\t" \ "mfc0\t%0, " #source ", " #sel "\n\t" \ ".set\tmips0\n\t" \ : "=r" (__res)); \ __res; \ }) /* #define CP0_COUNT $9 */ #define read_c0_count() __read_32bit_c0_register($9, 0) typedef unsigned int cycles_t; static inline cycles_t get_cycles (void) { return read_c0_count(); } #else /* debian: sparc, arm, m68k */ #warning You are compiling libardour on a platform for which ardour/cycles.h needs work #include typedef long cycles_t; extern cycles_t cacheflush_time; static inline cycles_t get_cycles(void) { struct timeval tv; gettimeofday (&tv, NULL); return tv.tv_usec; } #endif #endif /* __ardour_cycles_h__ */ freqtweak-0.7.2/src/FTspectragram.cpp0000644000175200017520000006233211226173741016544 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif // For compilers that support precompilation, includes "wx/wx.h". #include "wx/wxprec.h" #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include #include "FTspectragram.hpp" #include "FTmainwin.hpp" #include "FTioSupport.hpp" #include "FTtypes.hpp" int FTspectragram::_colorCount = 128; int FTspectragram::_maxColorCount = 256; int FTspectragram::_maxDiscreteColorCount = 16; int FTspectragram::_discreteColorCount = 10; unsigned char ** FTspectragram::_colorMap = 0; unsigned char ** FTspectragram::_discreteColors = 0; enum { FT_1Xscale=1000, FT_2Xscale, FT_LogaXscale, FT_LogbXscale, }; // the event tables connect the wxWindows events with the functions (event // handlers) which process them. It can be also done at run-time, but for the // simple menu events like this the static method is much simpler. BEGIN_EVENT_TABLE(FTspectragram, wxPanel) EVT_PAINT(FTspectragram::OnPaint) EVT_SIZE(FTspectragram::OnSize) EVT_MOTION(FTspectragram::OnMouseActivity) EVT_ENTER_WINDOW(FTspectragram::OnMouseActivity) EVT_LEAVE_WINDOW(FTspectragram::OnMouseActivity) EVT_MIDDLE_DOWN(FTspectragram::OnMouseActivity) EVT_MIDDLE_UP(FTspectragram::OnMouseActivity) EVT_RIGHT_DOWN(FTspectragram::OnMouseActivity) EVT_RIGHT_UP(FTspectragram::OnMouseActivity) EVT_MENU (FT_1Xscale,FTspectragram::OnXscaleMenu) EVT_MENU (FT_2Xscale,FTspectragram::OnXscaleMenu) EVT_MENU (FT_LogaXscale,FTspectragram::OnXscaleMenu) EVT_MENU (FT_LogbXscale,FTspectragram::OnXscaleMenu) END_EVENT_TABLE() FTspectragram::FTspectragram(FTmainwin * mwin, wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style , const wxString& name, PlotType pt) : wxPanel(parent, id, pos, size, style, name) , _mwin(mwin), _ptype(pt) , _width(0), _height(0) , _minCutoff(0.0), _dbAbsMin(-200.0), _dbAdjust(-38.0) , _yMin(-90.0), _yMax(0.0), _imageBuf(0) , _rasterImage(0), _rasterData(0) , _colorTableType(COLOR_BVRYW), _justresized(false) , _fillColor(20,120,120), _maxval(0.0), _xScaleType(XSCALE_1X) , _dataLength(1024) { initColorTable(); // max size _rasterData = new unsigned char[1600 * 3]; _rasterImage = new wxImage(1600, 1 , _rasterData, true); _points = new wxPoint[FT_MAX_FFT_SIZE/2 + 3]; _fillBrush.SetColour(_fillColor); _fillBrush.SetStyle(wxSOLID); _xscaleMenu = new wxMenu(wxT("")); _xscaleMenu->Append ( new wxMenuItem(_xscaleMenu, FT_1Xscale, wxT("1x Scale"))); _xscaleMenu->Append ( new wxMenuItem(_xscaleMenu, FT_2Xscale, wxT("2x Scale"))); _xscaleMenu->Append ( new wxMenuItem(_xscaleMenu, FT_LogaXscale, wxT("logA Scale"))); _xscaleMenu->Append ( new wxMenuItem(_xscaleMenu, FT_LogbXscale, wxT("logB Scale"))); _linePen.SetColour(255,255,255); updateSize(); } FTspectragram::~FTspectragram() { delete [] _rasterData; if (_imageBuf) delete _imageBuf; if (_rasterImage) delete _rasterImage; delete _xscaleMenu; delete [] _points; } void FTspectragram::setDataLength(unsigned int len) { // this is the new max length our raster // data needs to handle if (_rasterData) delete [] _rasterData; if ((int) len < _width) { _rasterData = new unsigned char[_width * 3]; _dataLength = _width; } else { _rasterData = new unsigned char[len * 3]; _dataLength = len; } if (_rasterImage) delete _rasterImage; //_rasterImage = new wxImage(_width, 1 , _rasterData, true); _rasterImage = new wxImage(_dataLength, 1 , _rasterData, true); } void FTspectragram::setPlotType (PlotType pt) { if (_ptype != pt) { _ptype = pt; _justresized = true; Refresh(TRUE); } } void FTspectragram::OnPaint(wxPaintEvent & event) { //printf ("Spectragram::OnPaint\n"); wxPaintDC dc(this); wxMemoryDC sdc; if (_justresized) { if (_imageBuf) delete _imageBuf; _imageBuf = new wxBitmap(_width, _height); sdc.SelectObject(*_imageBuf); sdc.SetBackground(*wxBLACK_BRUSH); sdc.Clear(); _justresized = false; } if (_imageBuf) { sdc.SelectObject(*_imageBuf); dc.Blit(0,0, _width, _height, &sdc, 0,0); } //event.Skip(); } void FTspectragram::updateSize() { int w,h; GetClientSize(&w, &h); //printf ("Spectragram::OnSize w=%d h=%d\n", _width, _height); if (w != _width || h != _height) { _justresized = true; } _width = w; _height = h; if (_width > (int) _dataLength) { setDataLength(_width); } else { if (_rasterImage) delete _rasterImage; //_rasterImage = new wxImage(_width, 1 , _rasterData, true); _rasterImage = new wxImage(_dataLength, 1 , _rasterData, true); } } void FTspectragram::OnSize(wxSizeEvent & event) { updateSize(); event.Skip(); } void FTspectragram::plotNextData (const float *data, int length) { if (_ptype == SPECTRAGRAM) { plotNextDataSpectragram (data, length); } else if (_ptype == AMPFREQ_LINES || _ptype == AMPFREQ_SOLID) { plotNextDataAmpFreq (data, length); } //printf ("maxval is %g\n", _maxval); } void FTspectragram::plotNextDataSpectragram (const float *data, int length) { wxClientDC dc(this); //wxMemoryDC rdc; //rdc.SelectObject(*_raster); wxMemoryDC sdc; if (_imageBuf) sdc.SelectObject(*_imageBuf); else return; //sdc.SetOptimization(true); //dc.SetOptimization(true); //rdc.SetOptimization(true); float dbval, sum; int coli, i, k, j; double xSkipD = (double)length / (double)_width; int xSkipI = (int)(xSkipD + 0.5); if (xSkipI < 1) xSkipI = 1; //wxPen pen = rdc.GetPen(); _xscale = (double)_width/(double)length; _length = length; int x1,x2; // if (_width >= length) if (_width == length) { /* if (_width > length) { //printf ("undersampled: w=%d l=%d sxale=%g\n", _width, length, xscale); rdc.SetUserScale(_xscale, 1.0); } */ // draw new raster for (int i=0; i < length; i++) { dbval = powerLogScale(data[i]); coli = (int) (((dbval - _yMin) / ( _yMax - _yMin)) * _colorCount); if (coli >= _colorCount) { coli = _colorCount-1; } else if (coli < 0) { coli = 0; } //pen.SetColour((int)_colorMap[coli][0], (int)_colorMap[coli][1], (int)_colorMap[coli][2] ); //rdc.SetPen(pen); //rdc.DrawLine(i,0,i+1,0); binToXRange(i, x1, x2, _length, _length); for (int n=x1; n <= x2; n++) { _rasterData[3*n] = _colorMap[coli][0]; _rasterData[3*n + 1] = _colorMap[coli][1]; _rasterData[3*n + 2] = _colorMap[coli][2]; } } } else if (_width > length) { double xscale = (double)_width / ((double)length-1); int xadj = (int) (xscale * 0.5); double xposf = -xadj; int lasti = 0; coli = 0; for(j = 0; j < length; j++, xposf+=xscale) { i = (int) lrint(xposf); while (lasti < i) { // fill blanks with last binToXRange(lasti, x1, x2, _length, _length); for (int n=x1; n <= x2; ++n) { _rasterData[3*n] = _colorMap[coli][0]; _rasterData[3*n+1] = _colorMap[coli][1]; _rasterData[3*n+2] = _colorMap[coli][2]; } ++lasti; } dbval = powerLogScale(data[j]); // normalize it from _dataRefMin/Max to 0-numcolors coli = (int) (((dbval - _yMin) / ( _yMax - _yMin)) * _colorCount); if (coli >= (int)_colorCount) { coli = (int) (_colorCount-1); } else if (coli < 0) { coli = 0; } } while (lasti < _width) { // fill blanks with last binToXRange(lasti, x1, x2, _length, _length); for (int n=x1; n <= x2; ++n) { _rasterData[3*n] = _colorMap[coli][0]; _rasterData[3*n+1] = _colorMap[coli][1]; _rasterData[3*n+2] = _colorMap[coli][2]; } ++lasti; } } else { j = 0; int nextj; for(i = 0; i < _width; i++) { nextj = (int)((i+1)*xSkipD + 0.5); sum = -100000; for (; j < nextj; ++j) { if ((data[j] ) > sum) { sum = (data[j] ); } } dbval = powerLogScale(sum); // normalize it from _dataRefMin/Max to 0-numcolors //coli = (int) (((sum - _dataRefMin) / refDiff) * _colorCount); coli = (int) (((dbval - _yMin) / ( _yMax - _yMin)) * _colorCount); if (coli >= (int) _colorCount) { coli = (int)_colorCount-1; } else if (coli < 0) { coli = 0; } binToXRange(i, x1, x2, _length, _length); for (int n=x1; n <= x2; ++n) { _rasterData[3*n] = _colorMap[coli][0]; _rasterData[3*n+1] = _colorMap[coli][1]; _rasterData[3*n+2] = _colorMap[coli][2]; } } } /* else { // Assume they want average // (_scaleType == DATA_MAX) //_dataElements = _plotWidth; for(i = 0; i < _width; i++) { sum = 0; for (k = 0, j = (int)(i*xSkipD); k < xSkipI; j++, k++) { sum += (data[j]); //if (sum < data[j]) { // sum = data[j]; //} } sum /= xSkipI; dbval = powerLogScale(sum); coli = (int) (((dbval - _yMin) / ( _yMax - _yMin)) * _colorCount); if (coli >= _colorCount) { coli = _colorCount-1; } else if (coli < 0) { coli = 0; } //printf ("dbval= %g coli=%d\n", dbval, coli); //pen.SetColour((int)_colorMap[coli][0], (int)_colorMap[coli][1], (int)_colorMap[coli][2] ); //rdc.SetPen(pen); //rdc.DrawLine(i,0, i+1, 0); binToXRange(i, x1, x2, _length, _length); for (int n=x1; n <= x2; n++) { _rasterData[3*n] = _colorMap[coli][0]; _rasterData[3*n + 1] = _colorMap[coli][1]; _rasterData[3*n + 2] = _colorMap[coli][2]; } } } */ // this is double buffered // move the specbuf down sdc.Blit(0,1,_width,_height-1, &sdc, 0, 0); // blit the new raster //sdc.Blit(0,0,_width, 1, &rdc, 0,0); //if (_width > length) { //printf ("undersampled: w=%d l=%d sxale=%g\n", _width, length, _xscale); // sdc.SetUserScale(_xscale, 1.0); //} sdc.DrawBitmap (wxBitmap (*_rasterImage), 0, 0, false); // blit to screen dc.Blit(0,0, _width, _height, &sdc, 0,0); } void FTspectragram::plotNextDataAmpFreq (const float *data, int length) { // printf ("Plot new data\n"); wxClientDC dc(this); wxMemoryDC sdc; if (_imageBuf) sdc.SelectObject(*_imageBuf); else return; //sdc.SetOptimization(true); //dc.SetOptimization(true); float dbval, sum; int yval, i, k, j; double xSkipD = (double)length / (double)_width; int xSkipI = (int)(xSkipD + 0.5); if (xSkipI < 1) xSkipI = 1; _xscale = (double)_width/(double)length; _length = length; sdc.SetBackground(*wxBLACK_BRUSH); sdc.Clear(); sdc.SetPen(_linePen); sdc.SetBrush(_fillBrush); _points[0].x = 0; _points[0].y = _height + 2; int x1,x2, lastx=0; if (_width >= length) { for (int i=0; i < length; i++) { dbval = powerLogScale(data[i]); yval = _height - (int) (((dbval - _yMin) / ( _yMax - _yMin)) * _height); if (yval >= _height) { yval = _height; } else if (yval < 0) { yval = 0; } switch (_ptype) { case AMPFREQ_LINES: if (_xScaleType != XSCALE_1X) { binToXRange(i, x1, x2, _length, _length); _points[i+2].x = (int) ( (x1+ ((x2-x1)>>1)) * _xscale); } else { _points[i+2].x = (int) (i * _xscale); } _points[i+2].y = yval; //printf ("avg dbval=%g yval=%d data=%g\n", dbval, yval, sum); break; case AMPFREQ_SOLID: binToXRange(i, x1, x2, _width, _length); sdc.DrawRectangle ( (int)(lastx), yval, (int) (x2-lastx) , _height-yval); lastx = x2; break; default: break; } //printf ("dbval=%g yval=%d data=%g\n", dbval, yval, data[i]); } if (_ptype == AMPFREQ_LINES) { _points[1].x = 0; _points[1].y = _points[2].y; _points[length].x = _width + 1; _points[length].y = _height + 2; _points[length+1].x = _points[0].x; _points[length+1].y = _points[0].y; // sdc.DrawLines(length+2, _points); sdc.DrawPolygon(length+2, _points); } } else { // Assume they want average // (_scaleType == DATA_MAX) //_dataElements = _plotWidth; for(i = 0; i < _width; i++) { sum = 0; for (k = 0, j = (int)(i*xSkipD); k < xSkipI; j++, k++) { sum += (data[j]); } sum /= xSkipI; dbval = powerLogScale(sum); yval = _height - (int) (((dbval - _yMin) / ( _yMax - _yMin)) * _height); if (yval >= _height) { yval = _height; } else if (yval < 0) { yval = 0; } switch (_ptype) { case AMPFREQ_LINES: if (_xScaleType != XSCALE_1X) { binToXRange(i, x1, x2, _width, _width); _points[i+1].x = (int) ( x1+ ((x2-x1)>>1)); } else { _points[i+1].x = (int) (i); } _points[i+2].y = yval; //printf ("avg dbval=%g yval=%d data=%g\n", dbval, yval, sum); break; case AMPFREQ_SOLID: // treat even points as x,y odd as width,height binToXRange(i, x1, x2, _width, _width); sdc.DrawRectangle ( lastx, yval, (x2-lastx), _height-yval); lastx = x2; break; default: break; } } //printf ("undersampled: w=%d l=%d sxale=%g\n", _width, length, xscale); //sdc.SetUserScale(_xscale, 1.0); if (_ptype == AMPFREQ_LINES) { _points[1].x = 0; _points[1].y = _points[2].y; _points[_width].x = _width+1; _points[_width].y = _height + 2; _points[_width+1].x = _points[0].x; _points[_width+1].y = _points[0].y; // sdc.DrawLines(_width+2, _points); sdc.DrawPolygon(_width+2, _points); } } // this is double buffered //sdc.SetTextForeground(*wxWHITE); //sdc.DrawText(wxString::Format("%g", _maxval), 0, 0); // blit to screen dc.Blit(0,0, _width, _height, &sdc, 0,0); } void FTspectragram::setXscale(XScaleType sc) { _xScaleType = sc; Refresh(FALSE); } void FTspectragram::initColorTable() { if (!_colorMap) { // this is only allocated once (and it is static) _colorMap = new unsigned char * [_maxColorCount]; for (int i=0; i < _maxColorCount; i++) { _colorMap[i] = new unsigned char[3]; } } if (!_discreteColors) { _discreteColors = new unsigned char * [_maxDiscreteColorCount]; for (int i=0; i < _maxDiscreteColorCount; i++) { _discreteColors[i] = new unsigned char[3]; } // for now we are just using if (_colorTableType == COLOR_GRAYSCALE) { _discreteColorCount = 2; // black _discreteColors[0][0] = 0; _discreteColors[0][1] = 0; _discreteColors[0][2] = 0; // white _discreteColors[1][0] = 0xff; _discreteColors[1][1] = 0xff; _discreteColors[1][2] = 0xff; } if (_colorTableType == COLOR_GREENSCALE) { _discreteColorCount = 2; // black _discreteColors[0][0] = 0; _discreteColors[0][1] = 0; _discreteColors[0][2] = 0; // green _discreteColors[1][0] = 0; _discreteColors[1][1] = 200; _discreteColors[1][2] = 0; } else if (_colorTableType == COLOR_BVRYW) { _discreteColorCount = 6; setDiscreteColor(0, 0, 0, 0); // black setDiscreteColor(1, 0, 0, 149); // blue setDiscreteColor(2, 57, 122, 138); // blue-green setDiscreteColor(3, 92, 165, 79); // green setDiscreteColor(4, 229, 171, 0); // orange setDiscreteColor(5, 255, 0, 18); // red /* _discreteColorCount = 7; // black _discreteColors[0][0] = 0; _discreteColors[0][1] = 0; _discreteColors[0][2] = 0; // blue _discreteColors[1][0] = 0; _discreteColors[1][1] = 0; _discreteColors[1][2] = 200; // violet _discreteColors[2][0] = 200; _discreteColors[2][1] = 0; _discreteColors[2][2] = 200; // red _discreteColors[3][0] = 200; _discreteColors[3][1] = 0; _discreteColors[3][2] = 0; // orangish _discreteColors[4][0] = 238; _discreteColors[4][1] = 118; _discreteColors[4][2] = 33; // yellow _discreteColors[5][0] = 200; _discreteColors[5][1] = 200; _discreteColors[5][2] = 0; // pale green _discreteColors[6][0] = 100; _discreteColors[6][1] = 160; _discreteColors[6][2] = 100; */ } } float seglen = _colorCount * 1.0/(_discreteColorCount-1); float ratio; int pos = 0; // printf ("seglen is %f\n", seglen); for (int dcol=0; dcol < _discreteColorCount-1; dcol++) { // fade this color into the next one for (int i=0; i < (int)seglen; i++) { ratio = i / seglen; _colorMap[i + pos][0] = (unsigned char) (_discreteColors[dcol][0]*(1-ratio) + _discreteColors[dcol+1][0]*ratio) & 0xff ; _colorMap[i + pos][1] = (unsigned char) (_discreteColors[dcol][1]*(1-ratio) + _discreteColors[dcol+1][1]*ratio) & 0xff ; _colorMap[i + pos][2] = (unsigned char) (_discreteColors[dcol][2]*(1-ratio) + _discreteColors[dcol+1][2]*ratio) & 0xff ; } pos += (int) seglen; } // finish off for (; pos < _colorCount; pos++) { _colorMap[pos][0] = (unsigned char) (_discreteColors[_discreteColorCount-1][0]); _colorMap[pos][1] = (unsigned char) (_discreteColors[_discreteColorCount-1][1]); _colorMap[pos][2] = (unsigned char) (_discreteColors[_discreteColorCount-1][2]); } } float FTspectragram::powerLogScale(float yval) { if (yval <= _minCutoff) { return _dbAbsMin; } // if (yval > _maxval) { // _maxval = yval; // } //float nval = (10.0 * FTutils::fast_log10(yval / _dataRefMax)); float nval = (10.0 * FTutils::fast_log10(yval)) + _dbAdjust; // printf ("scaled value is %g mincut=%g\n", nval, _minCutoff); return nval; } void FTspectragram::updatePositionLabels(int pX, int pY, bool showreal) { // calculate freq range and val for status bar float sfreq, efreq; int frombin, tobin; xToFreqRange(pX, sfreq, efreq, frombin, tobin); _freqstr.Printf (wxT("%5d - %5d Hz"), (int) sfreq, (int) efreq); _mwin->updatePosition ( _freqstr, wxT("") ); } void FTspectragram::xToFreqRange(int x, float &fromfreq, float &tofreq, int &frombin, int &tobin) { float freqPerBin = FTioSupport::instance()->getSampleRate()/(2.0 * (double)_length); //printf ("specmod length = %d freqperbin=%g\n", _specMod->getLength(), freqPerBin); xToBinRange(x, frombin, tobin); fromfreq = freqPerBin * frombin; tofreq = freqPerBin * tobin + freqPerBin; } /* void FTspectragram::xToBinRange(int x, int &frombin, int &tobin) { // converts x coord into filter bin // according to scaling int bin, lbin, rbin; int totbins = _length; //float xscale = _width / (float)totbins; if (x < 0) x = 0; else if (x >= _width) x = _width-1; if (_xScaleType == XSCALE_1X) { bin = rbin = lbin = (int)(x / _xscale); //printf (" %d %g %d\n", x, bin*xscale, (int)(bin * xscale)); // find lowest with same x while ( ((int)((lbin-1)*_xscale) == x) && (lbin > 0)) { lbin--; } // find highest with same x while ( ((int)((rbin+1)*_xscale) == x) && (rbin < totbins-1)) { rbin++; } frombin = lbin; tobin = rbin; } else { frombin = 0; tobin = 0; } //printf ("x=%d frombin=%d tobin=%d\n", x, frombin, tobin); } */ void FTspectragram::xToBinRange(int x, int &frombin, int &tobin) { // converts x coord into filter bin // according to scaling int bin, lbin, rbin; int totbins = _length; //int totbins = _specMod->getLength(); //float xscale = _width / (float)totbins; //if (x < 0) x = 0; //else if (x >= _width) x = _width-1; if (_xScaleType == XSCALE_1X) { bin = rbin = lbin = (int)(x / _xscale); //printf (" %d %g %d\n", x, bin*xscale, (int)(bin * xscale)); // find lowest with same x while ( ((int)((lbin-1)*_xscale) == x) && (lbin > 0)) { lbin--; } // find highest with same x while ( ((int)((rbin+1)*_xscale) == x) && (rbin < totbins-1)) { rbin++; } frombin = lbin; tobin = rbin; } else if (_xScaleType == XSCALE_2X) { float hxscale = _xscale * 2; if (x >= _width-2) { lbin = totbins/2; rbin = totbins-1; } else { bin = rbin = lbin = (int)(x / hxscale); //printf (" %d %g %d\n", x, bin*xscale, (int)(bin * xscale)); // find lowest with same x while ( ((int)((lbin-1)*hxscale) == x) && (lbin > 0)) { lbin--; } // find highest with same x while ( ((int)((rbin+1)*hxscale) == x) && (rbin < totbins>>1)) { rbin++; } } frombin = lbin; tobin = rbin; } else if (_xScaleType == XSCALE_LOGA) { if (x >= _width-1) { lbin = totbins/2; rbin = totbins-1; } else { float xscale = x / (float)_width; // use log scale for freq lbin = rbin = (int) pow ( totbins>>1, xscale) - 1; // find lowest with same x while ( (lbin > 0) && ((int)(((FTutils::fast_log10(lbin) / FTutils::fast_log10(totbins/2)) * _width)) == x)) { lbin--; } // find highest with same x while ( (rbin < totbins>>1) && ((int)(((FTutils::fast_log10(rbin) / FTutils::fast_log10(totbins/2)) )) == x)) { rbin++; } } frombin = lbin; tobin = rbin; // printf ("bin %d fromx=%d tox=%d\n", bin, fromx, tox); } else if (_xScaleType == XSCALE_LOGB) { if (x >= _width-1) { lbin = (int) (totbins/3.0); rbin = totbins-1; } else { float xscale = x / (float)_width; // use log scale for freq lbin = rbin = (int) pow ( (float)(totbins/3.0), xscale) - 1; // find lowest with same x while ( (lbin > 0) && ((int)(((FTutils::fast_log10(lbin) / FTutils::fast_log10(totbins/3.0)) * _width)) == x)) { lbin--; } // find highest with same x while ( (rbin < (int)(totbins/3.0)) && ((int)(((FTutils::fast_log10(rbin) / FTutils::fast_log10(totbins/3.0)) )) == x)) { rbin++; } } frombin = lbin; tobin = rbin; // printf ("bin %d fromx=%d tox=%d\n", bin, fromx, tox); } else { frombin = 0; tobin = 0; } //printf ("x=%d frombin=%d tobin=%d\n", x, frombin, tobin); } void FTspectragram::binToXRange(int bin, int &fromx, int &tox, int length, int bins) { // converts bin into x coord range // according to scaling int x, lx, rx; int totbins = bins; float xscale = length / (float)totbins; // assume width whatever passed in int width = length; //if (bin < 0) bin = 0; //else if (bin >= totbins) bin = totbins-1; if (_xScaleType == XSCALE_1X) { //bin = rbin = lbin = (int)(x / xscale); x = lx = rx = (int) (bin * xscale); //printf (" %d %g %d\n", x, bin*xscale, (int)(bin * xscale)); // find lowest x with same bin while ( ((int)((lx-1)/xscale) == bin) && (lx > 0)) { lx--; } // find highest with same x while ( ((int)((rx+1)/xscale) == bin) && (rx < width-1)) { rx++; } fromx = lx; tox = rx; } else if (_xScaleType == XSCALE_2X) { float hxscale = xscale * 2; if (bin >= totbins>>1) { rx = (int) (totbins * xscale); lx = rx - 2; } else { //bin = rbin = lbin = (int)(x / xscale); x = lx = rx = (int) (bin * hxscale ); //printf (" %d %g %d\n", x, bin*xscale, (int)(bin * xscale)); // find lowest x with same bin while ( ((int)((lx-1)/(hxscale)) == bin) && (lx > 0)) { lx--; } // find highest with same x while ( ((int)((rx+1)/hxscale) == bin) && (rx < width-1)) { rx++; } } fromx = lx; tox = rx; } else if (_xScaleType == XSCALE_LOGA) { // use log scale for freq if (bin > totbins/2) { lx = rx = (int) (totbins * xscale); } else if (bin == 0) { lx = 0; rx = (int) ((FTutils::fast_log10(bin+2) / FTutils::fast_log10(totbins*0.5)) * width); } else { lx = (int) ((FTutils::fast_log10(bin+1) / FTutils::fast_log10(totbins*0.5)) * width); rx = (int) ((FTutils::fast_log10(bin+2) / FTutils::fast_log10(totbins*0.5)) * width); } fromx = lx; tox = rx; // printf ("bin %d fromx=%d tox=%d\n", bin, fromx, tox); } else if (_xScaleType == XSCALE_LOGB) { // use log scale for freq if (bin > (int)(totbins*0.3333)) { lx = rx = (int) (totbins * xscale); } else if (bin == 0) { lx = 0; rx = (int) ((FTutils::fast_log10(bin+2) / FTutils::fast_log10(totbins*0.3333)) * width); } else { lx = (int) ((FTutils::fast_log10(bin+1) / FTutils::fast_log10(totbins*0.3333)) * width); rx = (int) ((FTutils::fast_log10(bin+2) / FTutils::fast_log10(totbins*0.3333)) * width); } fromx = lx; tox = rx; // printf ("bin %d fromx=%d tox=%d\n", bin, fromx, tox); } else { fromx = 0; tox = 0; } //printf ("bin=%d fromx=%d tox=%d\n", bin, fromx, tox); } void FTspectragram::OnMouseActivity( wxMouseEvent &event) { int pX = event.GetX(); int pY = event.GetY(); if (event.Moving() || event.Entering()) { updatePositionLabels(pX, pY, true); } else if (event.Leaving()) { _mwin->updatePosition(wxT(""), wxT("")); } else if (event.MiddleUp() || event.RightUp()) { // popup scale menu this->PopupMenu ( _xscaleMenu, pX, pY); } else { event.Skip(); } } void FTspectragram::OnXscaleMenu (wxCommandEvent &event) { //wxMenuItem *item = (wxMenuItem *) event.GetEventObject(); if (event.GetId() == FT_1Xscale) { _xScaleType = XSCALE_1X; } else if (event.GetId() == FT_2Xscale) { _xScaleType = XSCALE_2X; } else if (event.GetId() == FT_LogaXscale) { _xScaleType = XSCALE_LOGA; } else if (event.GetId() == FT_LogbXscale) { _xScaleType = XSCALE_LOGB; } else { event.Skip(); } Refresh(FALSE); } freqtweak-0.7.2/src/FTspectragram.hpp0000644000175200017520000000711011226173741016542 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTSPECTRAGRAM_HPP__ #define __FTSPECTRAGRAM_HPP__ #include #include #include "FTutils.hpp" #include "FTtypes.hpp" class FTmainwin; class FTspectragram : public wxPanel { //DECLARE_DYNAMIC_CLASS(FTspectragram) public: enum PlotType { SPECTRAGRAM = 0, AMPFREQ_SOLID, AMPFREQ_LINES, }; FTspectragram(FTmainwin *mwin, wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("Spectragram"), PlotType pt = SPECTRAGRAM); // PlotType pt = AMPFREQ_SOLID); // PlotType pt = AMPFREQ_LINES); virtual ~FTspectragram(); enum ColorTableType { COLOR_GRAYSCALE = 0, COLOR_BVRYW, COLOR_GREENSCALE }; void plotNextData (const float *data, int length); void setPlotType (PlotType pt); PlotType getPlotType() { return _ptype; } void setXscale(XScaleType sc); XScaleType getXscale() { return _xScaleType; } void setDataLength(unsigned int len); void OnPaint ( wxPaintEvent &event); void OnSize ( wxSizeEvent &event); void OnMouseActivity ( wxMouseEvent &event ); void OnXscaleMenu (wxCommandEvent &event); float powerLogScale(float yval); protected: void updateSize(); void initColorTable(); void plotNextDataSpectragram (const float *data, int length); void plotNextDataAmpFreq (const float *data, int length); void updatePositionLabels (int pX, int pY, bool showreal); void xToFreqRange(int x, float &fromfreq, float &tofreq, int &frombin, int &tobin); void xToBinRange(int x, int &frombin, int &tobin); void binToXRange(int bin, int &fromx, int &tox, int width, int bins); bool setDiscreteColor(int index, int r, int g, int b) { if (index < _discreteColorCount) { _discreteColors[index][0] = r; _discreteColors[index][1] = g; _discreteColors[index][2] = b; return true; } return false; } FTmainwin * _mwin; PlotType _ptype; int _width, _height; float _minCutoff; float _dbAbsMin; //float _dataRefMax; float _dbAdjust; float _yMin, _yMax; // bitmaps wxBitmap * _raster; wxBitmap * _imageBuf; wxImage * _rasterImage; unsigned char * _rasterData; wxPoint *_points; // color table stuff ColorTableType _colorTableType; static int _maxColorCount; static int _maxDiscreteColorCount; static int _colorCount; static int _discreteColorCount; static unsigned char **_colorMap; static unsigned char **_discreteColors; bool _justresized; wxBrush _fillBrush; wxColour _fillColor; wxPen _linePen; float _maxval; float _xscale; int _length; XScaleType _xScaleType; wxString _freqstr; wxMenu * _xscaleMenu; unsigned int _dataLength; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; #endif freqtweak-0.7.2/src/pixmaps/0000755000175200017520000000000011226201003014730 5ustar develdevelfreqtweak-0.7.2/src/pixmaps/gridsnap_normal.xpm0000644000175200017520000000113111226173741020652 0ustar develdevel/* XPM */ static char * gridsnap_normal_xpm[] = { "20 20 4 1", " c None", ". c #3C5572", "+ c #C48200", "@ c #88AD82", "....................", "....................", "....................", "....................", "+...................", "++..@@@@@@@@@@@@....", "+++.@..........@....", "++++@..........@...+", "+++++@@@@@@@@@@@..++", "++++@..........@.+++", "+++.@..........@++++", "++..@@@@@@@@@@@+++++", "+...@..........@++++", "....@..........@.+++", "....@@@@@@@@@@@@..++", "...................+", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/gridsnap_disabled.xpm0000644000175200017520000000113311226173741021133 0ustar develdevel/* XPM */ static char * gridsnap_disabled_xpm[] = { "20 20 4 1", " c None", ". c #414C58", "+ c #80632B", "@ c #7C9079", "....................", "....................", "....................", "....................", "+...................", "++..@@@@@@@@@@@@....", "+++.@..........@....", "++++@..........@...+", "+++++@@@@@@@@@@@..++", "++++@..........@.+++", "+++.@..........@++++", "++..@@@@@@@@@@@+++++", "+...@..........@++++", "....@..........@.+++", "....@@@@@@@@@@@@..++", "...................+", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/lineplot_disabled.xpm0000644000175200017520000000115211226173741021153 0ustar develdevel/* XPM */ static char * lineplot_disabled_xpm[] = { "20 20 5 1", " c None", ". c #495664", "+ c #000000", "@ c #FFFFFF", "# c #2D5E5E", "....................", "....................", "....................", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++++...", "...++++++@@++++++...", "...@+@+++@@+++++@...", "...@+@++@#@+++++@...", "...@+@++@##@+++@#...", "...#@#@@###@++@##...", "...#@#@@###@++@##...", "...#@#@#####@+@##...", "...#########@@###...", "...##########@###...", "...##########@###...", "...##############...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/link_focus.xpm0000644000175200017520000000306311226173741017635 0ustar develdevel/* XPM */ static char * link_focus_xpm[] = { "20 20 70 1", " c None", ". c #5A80AA", "+ c #567BA3", "@ c #517399", "# c #577BA4", "$ c #334456", "% c #4C4C4C", "& c #474746", "* c #364C66", "= c #587CA5", "- c #46576A", "; c #454545", "> c #363635", ", c #507196", "' c #313133", ") c #CDCDCE", "! c #C4C4C4", "~ c #C5C5C6", "{ c #BABABA", "] c #020204", "^ c #4F7095", "/ c #486586", "( c #4D4D4E", "_ c #ADADAC", ": c #C7C7C7", "< c #D2D2D2", "[ c #515152", "} c #517297", "| c #000000", "1 c #080C0F", "2 c #131B25", "3 c #334860", "4 c #52749A", "5 c #5A5A5A", "6 c #FFFFFF", "7 c #F2F2F3", "8 c #6F6F70", "9 c #6D8BAD", "0 c #507297", "a c #0B0E13", "b c #374D66", "c c #30445A", "d c #262627", "e c #7A7A7B", "f c #7B7B7C", "g c #6A6A6B", "h c #333334", "i c #6B6B6C", "j c #565657", "k c #555556", "l c #505052", "m c #202C3C", "n c #1C2634", "o c #1F2022", "p c #535354", "q c #555557", "r c #535355", "s c #52759B", "t c #52575E", "u c #C0C0C0", "v c #BEBEBF", "w c #ACACAD", "x c #4D5158", "y c #B9B9BA", "z c #BABABB", "A c #B5B5B7", "B c #6886A8", "C c #354B64", "D c #5A80A9", "E c #344962", "....................", "....................", "....................", "....................", "....................", "...+@@@@...+@@@@....", "..#$%%%&*.=-;%%>*...", "..,')!~{]^/(_:<<[...", "..})]]]|||||1]]2)...", "..,)3.4566678.49)...", "..0)abcdefegh*ci)...", "..0)jjkl]mnopqrr)...", "..stuuvw].}xyzAAB...", "...C]]]]..DE]]]]....", "....................", "....................", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/link_selected.xpm0000644000175200017520000000303011226173741020300 0ustar develdevel/* XPM */ static char * link_selected_xpm[] = { "20 20 68 1", " c None", ". c #7A9BBD", "+ c #7595B6", "@ c #6E8CAA", "# c #41505F", "$ c #4C4C4C", "% c #474746", "& c #495C71", "* c #7796B7", "= c #546272", "- c #454545", "; c #363635", "> c #6C89A7", ", c #313133", "' c #CDCDCE", ") c #C4C4C4", "! c #C5C5C6", "~ c #BABABA", "{ c #020204", "] c #6B88A6", "^ c #617A95", "/ c #4D4D4E", "( c #ADADAC", "_ c #C7C7C7", ": c #D2D2D2", "< c #515152", "[ c #6D8AA8", "} c #000000", "| c #0B0E11", "1 c #1A2028", "2 c #45576B", "3 c #6F8CAB", "4 c #5A5A5A", "5 c #FFFFFF", "6 c #F2F2F3", "7 c #6F6F70", "8 c #87A1BC", "9 c #0D1015", "0 c #495D71", "a c #415264", "b c #262627", "c c #7A7A7B", "d c #7B7B7C", "e c #6A6A6B", "f c #333334", "g c #6B6B6C", "h c #565657", "i c #555556", "j c #505052", "k c #2A3642", "l c #252E39", "m c #1F2022", "n c #535354", "o c #555557", "p c #535355", "q c #6F8DAC", "r c #565B60", "s c #C0C0C0", "t c #BEBEBF", "u c #ACACAD", "v c #51545A", "w c #B9B9BA", "x c #BABABB", "y c #B5B5B7", "z c #819CB7", "A c #485B6F", "B c #7A9ABC", "C c #46586C", "....................", "....................", "....................", "....................", "....................", "...+@@@@...+@@@@....", "..+#$$$%&.*=-$$;&...", "..>,')!~{]^/(_::<...", "..['{{{}}}}}|{{1'...", "..>'2.3455567.38'...", "..>'90abcdcef&ag'...", "..>'hhij{klmnopp'...", "..qrsstu{.[vwxyyz...", "...A{{{{..BC{{{{....", "....................", "....................", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/lineplot_active.xpm0000644000175200017520000000115011226173741020655 0ustar develdevel/* XPM */ static char * lineplot_active_xpm[] = { "20 20 5 1", " c None", ". c #DDCD7C", "+ c #000000", "@ c #FFFFFF", "# c #147878", "....................", "....................", "....................", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++++...", "...++++++@@++++++...", "...@+@+++@@+++++@...", "...@+@++@#@+++++@...", "...@+@++@##@+++@#...", "...#@#@@###@++@##...", "...#@#@@###@++@##...", "...#@#@#####@+@##...", "...#########@@###...", "...##########@###...", "...##########@###...", "...##############...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/barplot_focus.xpm0000644000175200017520000000112711226173741020342 0ustar develdevel/* XPM */ static char * barplot_focus_xpm[] = { "20 20 4 1", " c None", ". c #5A80AA", "+ c #000000", "@ c #FFFFFF", "....................", "....................", "....................", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++@+...", "...+@+++++++++@@+...", "...@@+++++++++@@+...", "...@@+++++++++@@@...", "...@@@++@+++++@@@...", "...@@@@@@+@++@@@@...", "...@@@@@@@@@+@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/specplot_disabled.xpm0000644000175200017520000000262511226173741021164 0ustar develdevel/* XPM */ static char * specplot_disabled_xpm[] = { "20 20 59 1", " c None", ". c #495664", "+ c #55786E", "@ c #446073", "# c #4C6F73", "$ c #486775", "% c #456374", "& c #3E5473", "* c #4F706E", "= c #4C6D73", "- c #56796C", "; c #4E7071", "> c #4C6E75", ", c #51746D", "' c #5A7D6A", ") c #496874", "! c #51726E", "~ c #587B6D", "{ c #53766D", "] c #597C6B", "^ c #5D826A", "/ c #648968", "( c #608569", "_ c #618668", ": c #698E65", "< c #678C67", "[ c #5F826A", "} c #7B8A51", "| c #868742", "1 c #748C57", "2 c #7E894C", "3 c #838847", "4 c #728C59", "5 c #7D8A4F", "6 c #668B68", "7 c #798A53", "8 c #6D8E5D", "9 c #96883D", "0 c #81894A", "a c #90873F", "b c #9E8A3B", "c c #93883E", "d c #8D8740", "e c #4E6F6F", "f c #415A74", "g c #628768", "h c #B08239", "i c #6B9063", "j c #718D5C", "k c #698D66", "l c #5C7F6A", "m c #394C72", "n c #435E74", "o c #3C5273", "p c #3F5774", "q c #374972", "r c #364671", "s c #3B4E72", "t c #313D72", "....................", "....................", "....................", "...+@#$%&%*=-=;>,...", "...'#%$@)!)=!+-#-...", "...,**~!{];=]!!>=...", "...^/(_::_-/<'[/]...", "...}|1213|24}5678...", "...93751703abc9da...", "...!!&%#,)ee!*[>f...", "...:g+(&[)%e;;8!=...", "...h3i}j/:6/k81g]...", "...lfm>f%nmfo+=%%...", "...l)m@p#%q@r+e&q...", "...(-^78'l[6{[6!{...", "..._erst$)&%p{'$=...", "...({pos@-o=m=~%&...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/specplot_active.xpm0000644000175200017520000000262311226173741020666 0ustar develdevel/* XPM */ static char * specplot_active_xpm[] = { "20 20 59 1", " c None", ". c #DDCD7C", "+ c #458975", "@ c #2E648B", "# c #3B7D85", "$ c #336D8B", "% c #30688B", "& c #25518D", "* c #3F827E", "= c #3A7B87", "- c #468A72", "; c #3D7F83", "> c #397A8A", ", c #428579", "' c #4A8F6C", ") c #35728A", "! c #41847C", "~ c #488C70", "{ c #438777", "] c #498E6E", "^ c #4D9367", "/ c #549B5B", "( c #509662", "_ c #519860", ": c #59A252", "< c #579E57", "[ c #4E9465", "} c #86A636", "| c #A6A823", "1 c #76A63F", "2 c #91A730", "3 c #9CA729", "4 c #71A542", "5 c #8CA733", "6 c #559D59", "7 c #81A639", "8 c #66A548", "9 c #C1A914", "0 c #96A72D", "a c #B6A81A", "b c #CCA90E", "c c #BCA917", "d c #B1A81D", "e c #3E8080", "f c #2A5A8C", "g c #52995E", "h c #E99002", "i c #5CA54F", "j c #6CA545", "k c #58A054", "l c #4C9169", "m c #1F428E", "n c #2C5F8C", "o c #234C8E", "p c #28558D", "q c #1C3D8F", "r c #1A398F", "s c #21478E", "t c #142A91", "....................", "....................", "....................", "...+@#$%&%*=-=;>,...", "...'#%$@)!)=!+-#-...", "...,**~!{];=]!!>=...", "...^/(_::_-/<'[/]...", "...}|1213|24}5678...", "...93751703abc9da...", "...!!&%#,)ee!*[>f...", "...:g+(&[)%e;;8!=...", "...h3i}j/:6/k81g]...", "...lfm>f%nmfo+=%%...", "...l)m@p#%q@r+e&q...", "...(-^78'l[6{[6!{...", "..._erst$)&%p{'$=...", "...({pos@-o=m=~%&...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/grid_active.xpm0000644000175200017520000000110611226173741017755 0ustar develdevel/* XPM */ static char * grid_active_xpm[] = { "20 20 3 1", " c None", ". c #DDCD7C", "+ c #7CAA74", "....................", "....................", "....................", "....................", "....................", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....................", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/lineplot_normal.xpm0000644000175200017520000000115011226173741020672 0ustar develdevel/* XPM */ static char * lineplot_normal_xpm[] = { "20 20 5 1", " c None", ". c #3C5572", "+ c #000000", "@ c #FFFFFF", "# c #147878", "....................", "....................", "....................", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++++...", "...++++++@@++++++...", "...@+@+++@@+++++@...", "...@+@++@#@+++++@...", "...@+@++@##@+++@#...", "...#@#@@###@++@##...", "...#@#@@###@++@##...", "...#@#@#####@+@##...", "...#########@@###...", "...##########@###...", "...##########@###...", "...##############...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/gridsnap_selected.xpm0000644000175200017520000000113311226173741021154 0ustar develdevel/* XPM */ static char * gridsnap_selected_xpm[] = { "20 20 4 1", " c None", ". c #7A9BBD", "+ c #C48200", "@ c #88AD82", "....................", "....................", "....................", "....................", "+...................", "++..@@@@@@@@@@@@....", "+++.@..........@....", "++++@..........@...+", "+++++@@@@@@@@@@@..++", "++++@..........@.+++", "+++.@..........@++++", "++..@@@@@@@@@@@+++++", "+...@..........@++++", "....@..........@.+++", "....@@@@@@@@@@@@..++", "...................+", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/grid_disabled.xpm0000644000175200017520000000111011226173741020244 0ustar develdevel/* XPM */ static char * grid_disabled_xpm[] = { "20 20 3 1", " c None", ". c #3B4754", "+ c #728B6E", "....................", "....................", "....................", "....................", "....................", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....................", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/gridsnap_focus.xpm0000644000175200017520000000113011226173741020500 0ustar develdevel/* XPM */ static char * gridsnap_focus_xpm[] = { "20 20 4 1", " c None", ". c #5A80AA", "+ c #C48200", "@ c #88AD82", "....................", "....................", "....................", "....................", "+...................", "++..@@@@@@@@@@@@....", "+++.@..........@....", "++++@..........@...+", "+++++@@@@@@@@@@@..++", "++++@..........@.+++", "+++.@..........@++++", "++..@@@@@@@@@@@+++++", "+...@..........@++++", "....@..........@.+++", "....@@@@@@@@@@@@..++", "...................+", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/barplot_active.xpm0000644000175200017520000000113011226173741020470 0ustar develdevel/* XPM */ static char * barplot_active_xpm[] = { "20 20 4 1", " c None", ". c #DDCD7C", "+ c #000000", "@ c #FFFFFF", "....................", "....................", "....................", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++@+...", "...+@+++++++++@@+...", "...@@+++++++++@@+...", "...@@+++++++++@@@...", "...@@@++@+++++@@@...", "...@@@@@@+@++@@@@...", "...@@@@@@@@@+@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/lineplot_focus.xpm0000644000175200017520000000114711226173741020527 0ustar develdevel/* XPM */ static char * lineplot_focus_xpm[] = { "20 20 5 1", " c None", ". c #5A80AA", "+ c #000000", "@ c #FFFFFF", "# c #147878", "....................", "....................", "....................", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++++...", "...++++++@@++++++...", "...@+@+++@@+++++@...", "...@+@++@#@+++++@...", "...@+@++@##@+++@#...", "...#@#@@###@++@##...", "...#@#@@###@++@##...", "...#@#@#####@+@##...", "...#########@@###...", "...##########@###...", "...##########@###...", "...##############...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/bypass_disabled.xpm0000644000175200017520000000214711226173741020633 0ustar develdevel/* XPM */ static char * bypass_disabled_xpm[] = { "20 20 39 1", " c None", ". c #485461", "+ c #505561", "@ c #565560", "# c #4A5461", "$ c #495461", "% c #925D62", "& c #B76264", "* c #B36264", "= c #885B61", "- c #BA6363", "; c #915C61", "> c #70575F", ", c #B66365", "' c #835A61", ") c #AC6164", "! c #7D585F", "~ c #575560", "{ c #59535E", "] c #9E5F63", "^ c #5E535C", "/ c #525561", "( c #8D5C62", "_ c #AF6264", ": c #B56264", "< c #AE6163", "[ c #58545F", "} c #4E5561", "| c #7E5960", "1 c #79585F", "2 c #545661", "3 c #875C61", "4 c #855A60", "5 c #74575E", "6 c #5F525C", "7 c #B86363", "8 c #535560", "9 c #6F565F", "0 c #5D525C", "....................", "....................", "....................", "..............+@....", ".....#.$%&*=..-;....", "....#.>-----,--'....", ".....>-)!~{=--]$....", "....$-)^../(_:<[....", "....%-!.}.--.|&1....", "....&-~..--'.+-=....", "....*-{/--=..2-3....", "....=-=(-'...4,5....", ".....,-_....67-8....", ".....--:|+247-9.....", "...+--]<&--,-9......", "...0;'$[1=358.......", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/barplot_disabled.xpm0000644000175200017520000000113211226173741020766 0ustar develdevel/* XPM */ static char * barplot_disabled_xpm[] = { "20 20 4 1", " c None", ". c #2D3D4E", "+ c #000000", "@ c #B8B8B8", "....................", "....................", "....................", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++@+...", "...+@+++++++++@@+...", "...@@+++++++++@@+...", "...@@+++++++++@@@...", "...@@@++@+++++@@@...", "...@@@@@@+@++@@@@...", "...@@@@@@@@@+@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/specplot_normal.xpm0000644000175200017520000000262311226173741020703 0ustar develdevel/* XPM */ static char * specplot_normal_xpm[] = { "20 20 59 1", " c None", ". c #3C5572", "+ c #458975", "@ c #2E648B", "# c #3B7D85", "$ c #336D8B", "% c #30688B", "& c #25518D", "* c #3F827E", "= c #3A7B87", "- c #468A72", "; c #3D7F83", "> c #397A8A", ", c #428579", "' c #4A8F6C", ") c #35728A", "! c #41847C", "~ c #488C70", "{ c #438777", "] c #498E6E", "^ c #4D9367", "/ c #549B5B", "( c #509662", "_ c #519860", ": c #59A252", "< c #579E57", "[ c #4E9465", "} c #86A636", "| c #A6A823", "1 c #76A63F", "2 c #91A730", "3 c #9CA729", "4 c #71A542", "5 c #8CA733", "6 c #559D59", "7 c #81A639", "8 c #66A548", "9 c #C1A914", "0 c #96A72D", "a c #B6A81A", "b c #CCA90E", "c c #BCA917", "d c #B1A81D", "e c #3E8080", "f c #2A5A8C", "g c #52995E", "h c #E99002", "i c #5CA54F", "j c #6CA545", "k c #58A054", "l c #4C9169", "m c #1F428E", "n c #2C5F8C", "o c #234C8E", "p c #28558D", "q c #1C3D8F", "r c #1A398F", "s c #21478E", "t c #142A91", "....................", "....................", "....................", "...+@#$%&%*=-=;>,...", "...'#%$@)!)=!+-#-...", "...,**~!{];=]!!>=...", "...^/(_::_-/<'[/]...", "...}|1213|24}5678...", "...93751703abc9da...", "...!!&%#,)ee!*[>f...", "...:g+(&[)%e;;8!=...", "...h3i}j/:6/k81g]...", "...lfm>f%nmfo+=%%...", "...l)m@p#%q@r+e&q...", "...(-^78'l[6{[6!{...", "..._erst$)&%p{'$=...", "...({pos@-o=m=~%&...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/bypass_focus.xpm0000644000175200017520000000231511226173741020200 0ustar develdevel/* XPM */ static char * bypass_focus_xpm[] = { "20 20 46 1", " c None", ". c #5A80AA", "+ c #647BA2", "@ c #6F769A", "# c #5D7FA8", "$ c #5B80AA", "% c #BE4F5C", "& c #E93A3B", "* c #E53C3E", "= c #B45464", "- c #ED3838", "; c #BD4F5D", "> c #95637C", ", c #EC3939", "' c #E83A3C", ") c #EC3838", "! c #AC586B", "~ c #DC4045", "{ c #A45C70", "] c #707599", "^ c #757395", "/ c #B35565", "( c #CD4851", "_ c #5B7FA9", ": c #7E6E8E", "< c #667AA1", "[ c #B95261", "} c #E03E42", "| c #E63B3D", "1 c #DE3F44", "2 c #737497", "3 c #617CA4", "4 c #A75A6E", "5 c #A15D73", "6 c #B35465", "7 c #6A789D", "8 c #B25566", "9 c #AF5668", "0 c #E83B3C", "a c #9C6077", "b c #806D8C", "c c #EA3A3B", "d c #68799F", "e c #92647E", "f c #657BA2", "g c #7D6F8F", "....................", "....................", "....................", "..............+@....", ".....#.$%&*=..-;....", "....#.>,----')-!....", ".....>,~{]^/--(_....", "....$,~:..<[}|12....", "....%-{.3.--.4&5....", "....&-]..)-!.+)=....", "....*-^<--6..7)8....", "....=-/[-!...90a....", ".....'-}....bc-d....", ".....)-|4+79c-e.....", "...f--(1&))0-e......", "...g;!_25=8ad.......", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/grid_normal.xpm0000644000175200017520000000110611226173741017772 0ustar develdevel/* XPM */ static char * grid_normal_xpm[] = { "20 20 3 1", " c None", ". c #3C5572", "+ c #88AD82", "....................", "....................", "....................", "....................", "....................", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....................", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/lineplot_selected.xpm0000644000175200017520000000115211226173741021174 0ustar develdevel/* XPM */ static char * lineplot_selected_xpm[] = { "20 20 5 1", " c None", ". c #7A9BBD", "+ c #000000", "@ c #FFFFFF", "# c #147878", "....................", "....................", "....................", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++++...", "...++++++@@++++++...", "...@+@+++@@+++++@...", "...@+@++@#@+++++@...", "...@+@++@##@+++@#...", "...#@#@@###@++@##...", "...#@#@@###@++@##...", "...#@#@#####@+@##...", "...#########@@###...", "...##########@###...", "...##########@###...", "...##############...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/barplot_normal.xpm0000644000175200017520000000113011226173741020505 0ustar develdevel/* XPM */ static char * barplot_normal_xpm[] = { "20 20 4 1", " c None", ". c #3C5572", "+ c #000000", "@ c #FFFFFF", "....................", "....................", "....................", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++@+...", "...+@+++++++++@@+...", "...@@+++++++++@@+...", "...@@+++++++++@@@...", "...@@@++@+++++@@@...", "...@@@@@@+@++@@@@...", "...@@@@@@@@@+@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/bypass_active.xpm0000644000175200017520000000226011226173741020333 0ustar develdevel/* XPM */ static char * bypass_active_xpm[] = { "20 20 44 1", " c None", ". c #DDCD7C", "+ c #DEC377", "@ c #DFB872", "# c #DDCA7B", "$ c #DDCC7C", "% c #E8674E", "& c #ED3C3A", "* c #EC403C", "= c #E77252", "- c #ED3838", "; c #E8694E", "> c #E39161", ", c #ED3939", "' c #EC3D3A", ") c #ED3938", "! c #E67A56", "~ c #EB4940", "{ c #E5825A", "] c #DFB772", "^ c #E0B26F", "/ c #E77353", "( c #E95947", "_ c #DDCC7B", ": c #E1A86B", "< c #DEC176", "[ c #E76D50", "} c #EC453E", "| c #EC3F3B", "1 c #EB473F", "2 c #E0B471", "3 c #DEC579", "4 c #E57F58", "5 c #E5855B", "6 c #DEC277", "7 c #E77253", "8 c #DFBD75", "9 c #E77453", "0 c #E67755", "a c #E48A5E", "b c #E1A66A", "c c #DFBE75", "d c #E39462", "e c #E1AA6C", "....................", "....................", "....................", "..............+@....", ".....#.$%&*=..-;....", "....#.>,----')-!....", ".....>,~{]^/--(_....", "....$,~:..<[}|12....", "....%-{.3.--.4&5....", "....&-]..)-!.6)=....", "....*-^<--7..8)9....", "....=-/[-!...0'a....", ".....'-}....b&-c....", ".....)-|4680&-d.....", "...6--(1&))'-d......", "...e;!_25=9ac.......", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/link_active.xpm0000644000175200017520000000302611226173741017770 0ustar develdevel/* XPM */ static char * link_active_xpm[] = { "20 20 68 1", " c None", ". c #DDCD7C", "+ c #D4C577", "@ c #C7B970", "# c #D5C577", "$ c #6D6642", "% c #4C4C4C", "& c #474746", "* c #83794B", "= c #D6C679", "- c #7F7855", "; c #454545", "> c #363635", ", c #C2B46E", "' c #313133", ") c #CDCDCE", "! c #C4C4C4", "~ c #C5C5C6", "{ c #BABABA", "] c #020204", "^ c #C2B46D", "/ c #ADA063", "( c #4D4D4E", "_ c #ADADAC", ": c #C7C7C7", "< c #D2D2D2", "[ c #515152", "} c #000000", "| c #14120B", "1 c #2D2A1C", "2 c #7C7347", "3 c #C8BA70", "4 c #5A5A5A", "5 c #FFFFFF", "6 c #F2F2F3", "7 c #6F6F70", "8 c #D6C988", "9 c #16140F", "0 c #837A4B", "a c #736B42", "b c #262627", "c c #7A7A7B", "d c #7B7B7C", "e c #6A6A6B", "f c #333334", "g c #6B6B6C", "h c #565657", "i c #555556", "j c #505052", "k c #4C462C", "l c #413C27", "m c #212121", "n c #535354", "o c #555557", "p c #535355", "q c #C9BA71", "r c #646258", "s c #C0C0C0", "t c #BEBEBF", "u c #ACACAD", "v c #C4B66F", "w c #5C5A53", "x c #B9B9BA", "y c #BABABB", "z c #B5B5B7", "A c #81784A", "B c #DCCC7C", "C c #7E7548", "....................", "....................", "....................", "....................", "....................", "...+@@@@...+@@@@....", "..#$%%%&*.=-;%%>*...", "..,')!~{]^/(_:<<[,..", "..%)]]]}}}}}|]]1)%..", "..%)2.3455567.38)%..", "..%)90abcdcef*ag)%..", "..&)hhij]klmnopp)&..", "..qrsstu].vwxyzz[q..", "...A]]]]..BC]]]]....", "....................", "....................", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/specplot_selected.xpm0000644000175200017520000000262511226173741021205 0ustar develdevel/* XPM */ static char * specplot_selected_xpm[] = { "20 20 59 1", " c None", ". c #7A9BBD", "+ c #458975", "@ c #2E648B", "# c #3B7D85", "$ c #336D8B", "% c #30688B", "& c #25518D", "* c #3F827E", "= c #3A7B87", "- c #468A72", "; c #3D7F83", "> c #397A8A", ", c #428579", "' c #4A8F6C", ") c #35728A", "! c #41847C", "~ c #488C70", "{ c #438777", "] c #498E6E", "^ c #4D9367", "/ c #549B5B", "( c #509662", "_ c #519860", ": c #59A252", "< c #579E57", "[ c #4E9465", "} c #86A636", "| c #A6A823", "1 c #76A63F", "2 c #91A730", "3 c #9CA729", "4 c #71A542", "5 c #8CA733", "6 c #559D59", "7 c #81A639", "8 c #66A548", "9 c #C1A914", "0 c #96A72D", "a c #B6A81A", "b c #CCA90E", "c c #BCA917", "d c #B1A81D", "e c #3E8080", "f c #2A5A8C", "g c #52995E", "h c #E99002", "i c #5CA54F", "j c #6CA545", "k c #58A054", "l c #4C9169", "m c #1F428E", "n c #2C5F8C", "o c #234C8E", "p c #28558D", "q c #1C3D8F", "r c #1A398F", "s c #21478E", "t c #142A91", "....................", "....................", "....................", "...+@#$%&%*=-=;>,...", "...'#%$@)!)=!+-#-...", "...,**~!{];=]!!>=...", "...^/(_::_-/<'[/]...", "...}|1213|24}5678...", "...93751703abc9da...", "...!!&%#,)ee!*[>f...", "...:g+(&[)%e;;8!=...", "...h3i}j/:6/k81g]...", "...lfm>f%nmfo+=%%...", "...l)m@p#%q@r+e&q...", "...(-^78'l[6{[6!{...", "..._erst$)&%p{'$=...", "...({pos@-o=m=~%&...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/gridsnap_active.xpm0000644000175200017520000000113111226173741020635 0ustar develdevel/* XPM */ static char * gridsnap_active_xpm[] = { "20 20 4 1", " c None", ". c #DDCD7C", "+ c #C48200", "@ c #88AD82", "....................", "....................", "....................", "....................", "+...................", "++..@@@@@@@@@@@@....", "+++.@..........@....", "++++@..........@...+", "+++++@@@@@@@@@@@..++", "++++@..........@.+++", "+++.@..........@++++", "++..@@@@@@@@@@@+++++", "+...@..........@++++", "....@..........@.+++", "....@@@@@@@@@@@@..++", "...................+", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/link_disabled.xpm0000644000175200017520000000260211226173741020263 0ustar develdevel/* XPM */ static char * link_disabled_xpm[] = { "20 20 58 1", " c None", ". c #444D57", "+ c #414A54", "@ c #3D454E", "# c #272B30", "$ c #444444", "% c #3E3E3E", "& c #282D33", "* c #424B55", "= c #383C41", "- c #3D3D3D", "; c #2F2F2F", "> c #3C444D", ", c #2B2B2C", "' c #B8B8B8", ") c #B0B0B0", "! c #A7A7A7", "~ c #010102", "{ c #3B434C", "] c #363D45", "^ c #454545", "/ c #9A9A9A", "( c #B2B2B2", "_ c #BCBCBC", ": c #484848", "< c #000000", "[ c #050606", "} c #0E1013", "| c #262B31", "1 c #505050", "2 c #E5E5E5", "3 c #D8D8D9", "4 c #636363", "5 c #575E66", "6 c #080809", "7 c #292E34", "8 c #25292E", "9 c #212122", "0 c #6D6D6D", "a c #6E6E6E", "b c #5F5F5F", "c c #2D2D2D", "d c #606060", "e c #4D4D4D", "f c #4C4C4C", "g c #474748", "h c #171A1E", "i c #15171A", "j c #1A1A1B", "k c #4A4A4A", "l c #4A4A4B", "m c #47494A", "n c #ACACAC", "o c #AAAAAA", "p c #434446", "q c #A6A6A6", "r c #A2A2A3", "s c #525961", "....................", "....................", "....................", "....................", "....................", "...+@@@@...+@@@@....", "..+#$$$%&.*=-$$;&...", "..>,'))!~{]^/(__:...", "..@'~~~<<<<<[~~}'...", "..>'|.@122234.@5'...", "..@'67890a0bc78d'...", "..@'eefg~hijkell'...", "..@mnno/~.@pq!rrs...", "...&~~~~...|~~~~....", "....................", "....................", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/grid_selected.xpm0000644000175200017520000000111011226173741020265 0ustar develdevel/* XPM */ static char * grid_selected_xpm[] = { "20 20 3 1", " c None", ". c #7A9BBD", "+ c #88AD82", "....................", "....................", "....................", "....................", "....................", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....................", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/specplot_focus.xpm0000644000175200017520000000262211226173741020531 0ustar develdevel/* XPM */ static char * specplot_focus_xpm[] = { "20 20 59 1", " c None", ". c #5A80AA", "+ c #458975", "@ c #2E648B", "# c #3B7D85", "$ c #336D8B", "% c #30688B", "& c #25518D", "* c #3F827E", "= c #3A7B87", "- c #468A72", "; c #3D7F83", "> c #397A8A", ", c #428579", "' c #4A8F6C", ") c #35728A", "! c #41847C", "~ c #488C70", "{ c #438777", "] c #498E6E", "^ c #4D9367", "/ c #549B5B", "( c #509662", "_ c #519860", ": c #59A252", "< c #579E57", "[ c #4E9465", "} c #86A636", "| c #A6A823", "1 c #76A63F", "2 c #91A730", "3 c #9CA729", "4 c #71A542", "5 c #8CA733", "6 c #559D59", "7 c #81A639", "8 c #66A548", "9 c #C1A914", "0 c #96A72D", "a c #B6A81A", "b c #CCA90E", "c c #BCA917", "d c #B1A81D", "e c #3E8080", "f c #2A5A8C", "g c #52995E", "h c #E99002", "i c #5CA54F", "j c #6CA545", "k c #58A054", "l c #4C9169", "m c #1F428E", "n c #2C5F8C", "o c #234C8E", "p c #28558D", "q c #1C3D8F", "r c #1A398F", "s c #21478E", "t c #142A91", "....................", "....................", "....................", "...+@#$%&%*=-=;>,...", "...'#%$@)!)=!+-#-...", "...,**~!{];=]!!>=...", "...^/(_::_-/<'[/]...", "...}|1213|24}5678...", "...93751703abc9da...", "...!!&%#,)ee!*[>f...", "...:g+(&[)%e;;8!=...", "...h3i}j/:6/k81g]...", "...lfm>f%nmfo+=%%...", "...l)m@p#%q@r+e&q...", "...(-^78'l[6{[6!{...", "..._erst$)&%p{'$=...", "...({pos@-o=m=~%&...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/grid_focus.xpm0000644000175200017520000000110511226173741017620 0ustar develdevel/* XPM */ static char * grid_focus_xpm[] = { "20 20 3 1", " c None", ". c #5A80AA", "+ c #88AD82", "....................", "....................", "....................", "....................", "....................", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....+..........+....", "....+..........+....", "....++++++++++++....", "....................", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/bypass_normal.xpm0000644000175200017520000000222211226173741020346 0ustar develdevel/* XPM */ static char * bypass_normal_xpm[] = { "20 20 42 1", " c None", ". c #3C5572", "+ c #48536E", "@ c #55516A", "# c #3F5471", "$ c #3D5572", "% c #B5414A", "& c #E8393A", "* c #E33A3B", "= c #A8434F", "- c #ED3838", "; c #B3414B", "> c #83495B", ", c #EC3838", "' c #E7393A", ") c #9F4552", "! c #D93B3F", "~ c #964655", "{ c #565169", "] c #5D5067", "^ c #A7434F", "/ c #C63E45", "( c #684E64", "_ c #4B536D", ": c #AE424D", "< c #DD3B3D", "[ c #E5393B", "} c #DB3B3E", "| c #5A5068", "1 c #45546F", "2 c #994654", "3 c #914756", "4 c #4F526C", "5 c #A6444F", "6 c #A24451", "7 c #8B4858", "8 c #6A4D63", "9 c #E93939", "0 c #4D526C", "a c #804A5C", "b c #49536E", "c c #664E64", "....................", "....................", "....................", "..............+@....", ".....#.$%&*=..-;....", "....#.>,----',-)....", ".....>,!~{]^--/$....", "....$,!(.._:<[}|....", "....%-~.1.--.2&3....", "....&-{..,-).+,=....", "....*-]_--=..4,5....", "....=-^:-)...6'7....", ".....'-<....89-0....", ".....,-[2+469-a.....", "...b--/}&,,'-a......", "...c;)$|3=570.......", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/bypass_selected.xpm0000644000175200017520000000232011226173741020645 0ustar develdevel/* XPM */ static char * bypass_selected_xpm[] = { "20 20 46 1", " c None", ". c #7A9BBD", "+ c #8294B4", "@ c #8A8DAA", "# c #7C99BA", "$ c #7A9BBC", "% c #C85762", "& c #EA3B3C", "* c #E73D3F", "= c #C05E6C", "- c #ED3838", "; c #C85863", "> c #A87388", ", c #EC3939", "' c #E93B3C", ") c #ED3839", "! c #BA6473", "~ c #E04347", "{ c #B4697A", "] c #8B8CA9", "^ c #8F89A4", "/ c #BF5F6D", "( c #D44E55", "_ c #7B9ABC", ": c #96839C", "< c #8393B2", "[ c #C45B67", "} c #E34144", "| c #E83D3E", "1 c #E14246", "2 c #8D8AA7", "3 c #8096B6", "4 c #B66777", "5 c #B16B7D", "6 c #C05F6C", "7 c #8790AE", "8 c #BF606D", "9 c #BC6270", "0 c #E93B3D", "a c #AD6F82", "b c #98819B", "c c #EA3A3B", "d c #8591B0", "e c #A6758A", "f c #8394B3", "g c #95849E", "....................", "....................", "....................", "..............+@....", ".....#.$%&*=..-;....", "....#.>,----')-!....", ".....>,~{]^/--(_....", "....$,~:..<[}|12....", "....%-{.3.--.4&5....", "....&-]..)-!.+)=....", "....*-^<--6..7)8....", "....=-/[-!...90a....", ".....'-}....bc-d....", ".....)-|4+79c-e.....", "...f--(1&))0-e......", "...g;!_25=8ad.......", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/link_normal.xpm0000644000175200017520000000304511226173741020006 0ustar develdevel/* XPM */ static char * link_normal_xpm[] = { "20 20 69 1", " c None", ". c #3C5572", "+ c #3A526E", "@ c #364D67", "# c #26313E", "$ c #4C4C4C", "% c #474746", "& c #243345", "* c #3B536F", "= c #394451", "- c #454545", "; c #363635", "> c #354B65", ", c #313133", "' c #CDCDCE", ") c #C4C4C4", "! c #C5C5C6", "~ c #BABABA", "{ c #020204", "] c #354B64", "^ c #31455B", "/ c #4D4D4E", "( c #ADADAC", "_ c #C7C7C7", ": c #D2D2D2", "< c #515152", "[ c #364C66", "} c #000000", "| c #05080A", "1 c #0D121A", "2 c #364C65", "3 c #223041", "4 c #5A5A5A", "5 c #FFFFFF", "6 c #F2F2F3", "7 c #6F6F70", "8 c #556980", "9 c #080A0E", "0 c #253446", "a c #212E3D", "b c #262627", "c c #7A7A7B", "d c #7B7B7C", "e c #6A6A6B", "f c #333334", "g c #253345", "h c #6B6B6C", "i c #565657", "j c #555556", "k c #505052", "l c #161E29", "m c #131A24", "n c #1E1F21", "o c #535354", "p c #555557", "q c #535355", "r c #374E68", "s c #4E5256", "t c #C0C0C0", "u c #BEBEBF", "v c #ACACAD", "w c #374D66", "x c #494C51", "y c #B9B9BA", "z c #BABABB", "A c #B5B5B7", "B c #50647B", "C c #243244", "D c #233142", "....................", "....................", "....................", "....................", "....................", "...+@@@@...+@@@@....", "..+#$$$%&.*=-$$;&...", "..>,')!~{]^/(_::<...", "..['{{{}}}}}|{{1'...", "..2'3.@455567.@8'...", "..['90abcdcefgah'...", "..['iijk{lmnopqq'...", "..rsttuv{.wxyzAAB...", "...C{{{{...D{{{{....", "....................", "....................", "....................", "....................", "....................", "...................."}; freqtweak-0.7.2/src/pixmaps/barplot_selected.xpm0000644000175200017520000000113211226173741021007 0ustar develdevel/* XPM */ static char * barplot_selected_xpm[] = { "20 20 4 1", " c None", ". c #7A9BBD", "+ c #000000", "@ c #FFFFFF", "....................", "....................", "....................", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++++...", "...++++++++++++@+...", "...+@+++++++++@@+...", "...@@+++++++++@@+...", "...@@+++++++++@@@...", "...@@@++@+++++@@@...", "...@@@@@@+@++@@@@...", "...@@@@@@@@@+@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "...@@@@@@@@@@@@@@...", "....................", "....................", "...................."}; freqtweak-0.7.2/src/xml++.cpp0000644000175200017520000001540511226173741014727 0ustar develdevel/* xml++.cc * libxml++ and this file are copyright (C) 2000 by Ari Johnson, and * are covered by the GNU Lesser General Public License, which should be * included with libxml++ as the file COPYING. */ #include "xml++.hpp" static XMLNode *readnode(xmlNodePtr); static void writenode(xmlDocPtr, XMLNode *, xmlNodePtr, int); XMLTree::XMLTree(const XMLTree * from) { _filename = from->filename(); _root = new XMLNode(*from->root()); _compression = from->compression(); _initialized = true; } XMLTree::~XMLTree() { if (_initialized && _root) delete _root; } int XMLTree::set_compression(int c) { if (c > 9) c = 9; if (c < 0) c = 0; _compression = c; return _compression; } bool XMLTree::read(void) { xmlDocPtr doc; if (_root) { delete _root; _root = NULL; } xmlKeepBlanksDefault(0); doc = xmlParseFile(_filename.c_str()); if (!doc) { _initialized = false; return false; } _root = readnode(xmlDocGetRootElement(doc)); xmlFreeDoc(doc); _initialized = true; return true; } bool XMLTree::read_buffer(const string & buffer) { xmlDocPtr doc; _filename = ""; if (_root) { delete _root; _root = NULL; } doc = xmlParseMemory((char *) buffer.c_str(), buffer.length()); if (!doc) { _initialized = false; return false; } _root = readnode(xmlDocGetRootElement(doc)); xmlFreeDoc(doc); _initialized = true; return true; } bool XMLTree::write(void) const { xmlDocPtr doc; XMLNodeList children; int result; xmlKeepBlanksDefault(0); doc = xmlNewDoc((xmlChar *) "1.0"); xmlSetDocCompressMode(doc, _compression); writenode(doc, _root, doc->children, 1); result = xmlSaveFormatFile(_filename.c_str(), doc, 1); xmlFreeDoc(doc); if (result == -1) return false; return true; } const string & XMLTree::write_buffer(void) const { static string retval; char *ptr; int len; xmlDocPtr doc; XMLNodeList children; xmlKeepBlanksDefault(0); doc = xmlNewDoc((xmlChar *) "1.0"); xmlSetDocCompressMode(doc, _compression); writenode(doc, _root, doc->children, 1); xmlDocDumpMemory(doc, (xmlChar **) & ptr, &len); xmlFreeDoc(doc); retval = ptr; free(ptr); return retval; } XMLNode::XMLNode(const string & n) : _name(n), _is_content(false), _content(string()) { if (_name.empty()) _initialized = false; else _initialized = true; } XMLNode::XMLNode(const string & n, const string & c) :_name(string()), _is_content(true), _content(c) { _initialized = true; } XMLNode::XMLNode(const XMLNode& from) : _initialized(false) { XMLPropertyList props; XMLPropertyIterator curprop; XMLNodeList nodes; XMLNodeIterator curnode; _name = from.name(); set_content(from.content()); props = from.properties(); for (curprop = props.begin(); curprop != props.end(); curprop++) add_property((*curprop)->name(), (*curprop)->value()); nodes = from.children(); for (curnode = nodes.begin(); curnode != nodes.end(); curnode++) add_child_copy(**curnode); } XMLNode::~XMLNode() { XMLNodeIterator curchild; XMLPropertyIterator curprop; for (curchild = _children.begin(); curchild != _children.end(); curchild++) delete *curchild; for (curprop = _proplist.begin(); curprop != _proplist.end(); curprop++) delete *curprop; } const string & XMLNode::set_content(const string & c) { if (c.empty()) _is_content = false; else _is_content = true; _content = c; return _content; } const XMLNodeList & XMLNode::children(const string & n) const { static XMLNodeList retval; XMLNodeConstIterator cur; if (n.length() == 0) return _children; retval.erase(retval.begin(), retval.end()); for (cur = _children.begin(); cur != _children.end(); cur++) if ((*cur)->name() == n) retval.insert(retval.end(), *cur); return retval; } XMLNode *XMLNode::add_child(const string & n) { return add_child_copy(XMLNode (n)); } void XMLNode::add_child_nocopy (XMLNode& n) { _children.insert(_children.end(), &n); } XMLNode * XMLNode::add_child_copy(const XMLNode& n) { XMLNode *copy = new XMLNode (n); _children.insert(_children.end(), copy); return copy; } XMLNode *XMLNode::add_content(const string & c) { return add_child_copy(XMLNode (string(), c)); } XMLProperty *XMLNode::property(const string & n) { if (_propmap.find(n) == _propmap.end()) return NULL; return _propmap[n]; } XMLProperty *XMLNode::add_property(const string & n, const string & v) { if(_propmap.find(n) != _propmap.end()){ remove_property(n); } XMLProperty *tmp = new XMLProperty(n, v); if (!tmp) return NULL; _propmap[tmp->name()] = tmp; _proplist.insert(_proplist.end(), tmp); return tmp; } void XMLNode::remove_property(const string & n) { if (_propmap.find(n) != _propmap.end()) { _proplist.remove(_propmap[n]); _propmap.erase(n); } } void XMLNode::remove_nodes(const string & n) { XMLNodeIterator i = _children.begin(); XMLNodeIterator tmp; while (i != _children.end()) { tmp = i; ++tmp; if ((*i)->name() == n) { _children.remove(*i); } i = tmp; } } static XMLNode *readnode(xmlNodePtr node) { string name, content; xmlNodePtr child; XMLNode *tmp; xmlAttrPtr attr; if (node->name) name = (char *) node->name; else name = string(); tmp = new XMLNode(name); for (attr = node->properties; attr; attr = attr->next) { name = (char *) attr->name; content = ""; if (attr->children) content = (char *) attr->children->content; tmp->add_property(name, content); } if (node->content) tmp->set_content((char *) node->content); else tmp->set_content(string()); for (child = node->children; child; child = child->next) tmp->add_child_nocopy (*readnode(child)); return tmp; } static void writenode(xmlDocPtr doc, XMLNode * n, xmlNodePtr p, int root = 0) { XMLPropertyList props; XMLPropertyIterator curprop; XMLNodeList children; XMLNodeIterator curchild; xmlNodePtr node; if (root) node = doc->children = xmlNewDocNode(doc, NULL, (xmlChar *) n->name().c_str(), NULL); else node = xmlNewChild(p, NULL, (xmlChar *) n->name().c_str(), NULL); if (n->is_content()) { node->type = XML_TEXT_NODE; xmlNodeSetContentLen(node, (const xmlChar *) n->content().c_str(), n->content().length()); } props = n->properties(); for (curprop = props.begin(); curprop != props.end(); curprop++) xmlSetProp(node, (xmlChar *) (*curprop)->name().c_str(), (xmlChar *) (*curprop)->value().c_str()); children = n->children(); for (curchild = children.begin(); curchild != children.end(); curchild++) writenode(doc, *curchild, node); } freqtweak-0.7.2/src/xml++.hpp0000644000175200017520000000646411226173741014741 0ustar develdevel/* xml++.h * libxml++ and this file are copyright (C) 2000 by Ari Johnson, and * are covered by the GNU Lesser General Public License, which should be * included with libxml++ as the file COPYING. */ #include #include #include #include #include #include #include #ifndef __XMLPP_H #define __XMLPP_H using std::string; using std::map; using std::list; class XMLTree; class XMLNode; typedef list XMLNodeList; typedef XMLNodeList::iterator XMLNodeIterator; typedef XMLNodeList::const_iterator XMLNodeConstIterator; class XMLProperty; typedef list XMLPropertyList; typedef XMLPropertyList::iterator XMLPropertyIterator; typedef XMLPropertyList::const_iterator XMLPropertyConstIterator; typedef map XMLPropertyMap; class XMLTree { private: string _filename; XMLNode *_root; int _compression; bool _initialized; public: XMLTree() : _filename(), _root(0), _compression(0), _initialized(false) { }; XMLTree(const string &fn) : _filename(fn), _root(0), _compression(0), _initialized(false) { read(); }; XMLTree(const XMLTree *); ~XMLTree(); bool initialized() const { return _initialized; }; XMLNode *root() const { return _root; }; XMLNode *set_root(XMLNode *n) { return _root = n; }; const string & filename() const { return _filename; }; const string & set_filename(const string &fn) { return _filename = fn; }; int compression() const { return _compression; }; int set_compression(int); bool read(); bool read(const string &fn) { set_filename(fn); return read(); }; bool read_buffer(const string &); bool write() const; bool write(const string &fn) { set_filename(fn); return write(); }; const string & write_buffer() const; }; class XMLNode { private: bool _initialized; string _name; bool _is_content; string _content; XMLNodeList _children; XMLPropertyList _proplist; XMLPropertyMap _propmap; public: XMLNode(const string &); XMLNode(const string &, const string &); XMLNode(const XMLNode&); ~XMLNode(); bool initialized() const { return _initialized; }; const string name() const { return _name; }; bool is_content() const { return _is_content; }; const string & content() const { return _content; }; const string & set_content(const string &); XMLNode *add_content(const string & = string()); const XMLNodeList & children(const string & = string()) const; XMLNode *add_child(const string &); XMLNode *add_child_copy(const XMLNode&); void add_child_nocopy (XMLNode&); const XMLPropertyList & properties() const { return _proplist; }; XMLProperty *property(const string &); const XMLProperty *property(const string &n) const { return ((XMLNode *) this)->property(n); }; XMLProperty *add_property(const string &, const string & = string()); void remove_property(const string &); /** Remove all nodes with the name passed to remove_nodes */ void remove_nodes(const string &); }; class XMLProperty { private: string _name; string _value; public: XMLProperty(const string &n, const string &v = string()) : _name(n), _value(v) { }; const string & name() const { return _name; }; const string & value() const { return _value; }; const string & set_value(const string &v) { return _value = v; }; }; #endif /* __XML_H */ freqtweak-0.7.2/src/FTprocOrderDialog.cpp0000644000175200017520000002522311226173741017311 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include #include #include "FTprocOrderDialog.hpp" #include "FTioSupport.hpp" #include "FTmainwin.hpp" #include "FTdspManager.hpp" #include "FTprocI.hpp" #include "FTprocessPath.hpp" #include "FTspectralEngine.hpp" enum { ID_AddButton=8000, ID_UpButton, ID_DownButton, ID_RemoveButton, ID_CommitButton, ID_CloseButton, ID_SourceList, ID_TargetList, ID_AutoCheck }; BEGIN_EVENT_TABLE(FTprocOrderDialog, wxFrame) EVT_CLOSE(FTprocOrderDialog::onClose) EVT_BUTTON(ID_UpButton, FTprocOrderDialog::onTargetButtons) EVT_BUTTON(ID_DownButton, FTprocOrderDialog::onTargetButtons) EVT_BUTTON(ID_RemoveButton, FTprocOrderDialog::onTargetButtons) EVT_BUTTON(ID_CommitButton, FTprocOrderDialog::onCommit) EVT_BUTTON(ID_AddButton, FTprocOrderDialog::onAddButton) EVT_CHECKBOX(ID_AutoCheck, FTprocOrderDialog::onAutoCheck) EVT_SIZE (FTprocOrderDialog::onSize) EVT_PAINT (FTprocOrderDialog::onPaint) END_EVENT_TABLE() FTprocOrderDialog::FTprocOrderDialog(FTmainwin * parent, wxWindowID id, const wxString & title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxFrame(parent, id, title, pos, size, style, name), _mainwin(parent) { init(); } FTprocOrderDialog::~FTprocOrderDialog() { } void FTprocOrderDialog::onSize(wxSizeEvent &ev) { _justResized = true; ev.Skip(); } void FTprocOrderDialog::onPaint(wxPaintEvent &ev) { if (_justResized) { int width,height; _justResized = false; _sourceList->GetClientSize(&width, &height); _sourceList->SetColumnWidth(0, width); _targetList->GetClientSize(&width, &height); _targetList->SetColumnWidth(0, width); } ev.Skip(); } void FTprocOrderDialog::init() { wxBoxSizer * mainsizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer * sourceSizer = new wxBoxSizer(wxVERTICAL); _sourceList = new wxListCtrl (this, ID_SourceList, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER); _sourceList->InsertColumn(0, wxT("Available Modules")); sourceSizer->Add (_sourceList, 1, wxEXPAND|wxALL, 2); mainsizer->Add (sourceSizer, 1, wxEXPAND|wxALL, 6); wxBoxSizer *midbuttSizer = new wxBoxSizer(wxVERTICAL); wxButton * butt; midbuttSizer->Add (-1, 20); butt = new wxButton(this, ID_AddButton, wxT("Add ->"), wxDefaultPosition, wxSize(-1,-1)); midbuttSizer->Add(butt, 0, wxEXPAND|wxALL, 2); butt = new wxButton(this, ID_RemoveButton, wxT("Remove"), wxDefaultPosition, wxSize(-1,-1)); midbuttSizer->Add(butt, 0, wxEXPAND|wxALL, 2); midbuttSizer->Add (-1, 15); butt = new wxButton(this, ID_UpButton, wxT("Up"), wxDefaultPosition, wxSize(-1,-1)); midbuttSizer->Add(butt, 0, wxEXPAND|wxALL, 2); butt = new wxButton(this, ID_DownButton, wxT("Down"), wxDefaultPosition, wxSize(-1, -1)); midbuttSizer->Add(butt, 0, wxEXPAND|wxALL, 2); midbuttSizer->Add (-1, 5, 1); _modifiedText = new wxStaticText (this, -1, wxT(""), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE); midbuttSizer->Add(_modifiedText, 0, wxALL|wxEXPAND|wxALIGN_CENTRE_VERTICAL|wxALIGN_CENTRE, 3); //butt = new wxButton(this, ID_CloseButton, "Close"); //midbuttSizer->Add(butt, 1, wxALL, 2); mainsizer->Add (midbuttSizer, 0, wxEXPAND|wxALL, 4); wxBoxSizer * targSizer = new wxBoxSizer(wxVERTICAL); _targetList = new wxListCtrl (this, ID_TargetList, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxSUNKEN_BORDER|wxLC_SINGLE_SEL); _targetList->InsertColumn(0, wxT("Configured Modules")); targSizer->Add (_targetList, 1, wxEXPAND|wxALL, 2); // button bar wxBoxSizer * buttSizer = new wxBoxSizer(wxHORIZONTAL); _autoCheck = new wxCheckBox(this, ID_AutoCheck, wxT("Auto")); buttSizer->Add( _autoCheck, 0, wxALL, 2); butt = new wxButton(this, ID_CommitButton, wxT("Commit")); buttSizer->Add(butt, 1, wxALL, 2); targSizer->Add(buttSizer, 0, wxALL|wxEXPAND, 0); mainsizer->Add(targSizer, 1, wxALL|wxEXPAND, 6); refreshState(); SetAutoLayout( TRUE ); mainsizer->Fit( this ); mainsizer->SetSizeHints( this ); SetSizer( mainsizer ); this->SetSizeHints(200,100); } void FTprocOrderDialog::refreshState() { _sourceList->DeleteAllItems(); wxListItem item; item.SetColumn(0); item.SetMask (wxLIST_MASK_TEXT|wxLIST_MASK_DATA); // get available modules FTdspManager::ModuleList mlist; FTdspManager::instance()->getAvailableModules (mlist); FTdspManager::ModuleList::iterator mod = mlist.begin(); unsigned int pos = 0; for (; mod != mlist.end(); ++mod) { item.SetText (wxString::FromAscii ((*mod)->getName().c_str())); item.SetData ((unsigned) (*mod)); item.SetId(pos++); _sourceList->InsertItem(item); } // get configured modules from the first procpath _targetList->DeleteAllItems(); FTprocessPath * procpath = FTioSupport::instance()->getProcessPath(0); if (procpath) { FTspectralEngine *engine = procpath->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); for (unsigned int n=0; n < procmods.size(); ++n) { item.SetText (wxString::FromAscii (procmods[n]->getName().c_str())); item.SetData ((unsigned) procmods[n]); item.SetId (n); _targetList->InsertItem(item); } } if (_lastSelected >= 0 && _lastSelected < _targetList->GetItemCount()) { _targetList->SetItemState (_lastSelected, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); } _actions.clear(); _modifiedText->SetLabel (wxT("")); } void FTprocOrderDialog::onClose(wxCloseEvent & ev) { if (!ev.CanVeto()) { Destroy(); } else { ev.Veto(); Show(false); } } void FTprocOrderDialog::onAutoCheck (wxCommandEvent &ev) { if (_autoCheck->GetValue() == true) { // commit immediately onCommit(ev); } } void FTprocOrderDialog::onCommit(wxCommandEvent & ev) { //_mainwin->suspendProcessing(); FTioSupport * iosup = FTioSupport::instance(); // do this for every active process path FTprocessPath * procpath; for (int i=0; i < iosup->getActivePathCount(); ++i) { procpath = iosup->getProcessPath(i); if (!procpath) break; FTspectralEngine *engine = procpath->getSpectralEngine(); // go through the actions for (list::iterator action = _actions.begin(); action != _actions.end(); ++action) { ModAction & act = *action; if (act.remove) { engine->removeProcessorModule ((unsigned int) act.from); } else if (act.from < 0) { // no from, this is an addition FTprocI * newproc = act.procmod->clone(); newproc->initialize(); engine->appendProcessorModule (newproc); } else { // this is a move engine->moveProcessorModule ((unsigned int) act.from, (unsigned int) act.to); } } } _actions.clear(); // rebuild UI parts _mainwin->rebuildDisplay(false); // _mainwin->restoreProcessing(); refreshState(); } void FTprocOrderDialog::onTargetButtons(wxCommandEvent & ev) { int id = ev.GetId(); int itemi; if (id == ID_RemoveButton) { itemi = _targetList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (itemi != -1) { _targetList->DeleteItem(itemi); _actions.push_back (ModAction ((FTprocI*) _targetList->GetItemData(itemi), itemi , -1, true)); if (itemi >= _targetList->GetItemCount()) itemi -= 1; _targetList->SetItemState (itemi, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); _lastSelected = itemi; if (_autoCheck->GetValue()) { // commit immediately onCommit(ev); } else { _modifiedText->SetLabel (wxT("* modified *")); } } } else if (id == ID_UpButton) { itemi = _targetList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (itemi > 0) { // swap with item above wxListItem item; item.SetId(itemi); item.SetMask(wxLIST_MASK_STATE|wxLIST_MASK_TEXT|wxLIST_MASK_DATA); _targetList->GetItem (item); _targetList->DeleteItem(itemi); item.SetId(itemi-1); _targetList->InsertItem(item); _targetList->SetItemState (itemi-1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); _actions.push_back (ModAction ((FTprocI*) item.GetData(), itemi , itemi-1, false)); _lastSelected = itemi-1; if (_autoCheck->GetValue()) { // commit immediately onCommit(ev); } else { _modifiedText->SetLabel (wxT("* modified *")); } } } else if (id == ID_DownButton) { itemi = _targetList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (itemi != -1 && itemi < _targetList->GetItemCount()-1) { // swap with item below wxListItem item; item.SetId(itemi); item.SetMask(wxLIST_MASK_STATE|wxLIST_MASK_TEXT|wxLIST_MASK_DATA); _targetList->GetItem (item); _targetList->DeleteItem(itemi); item.SetId(itemi+1); _targetList->InsertItem(item); _targetList->SetItemState (itemi+1, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); _actions.push_back (ModAction ((FTprocI*) item.GetData(), itemi , itemi+1, false)); _lastSelected = itemi+1; if (_autoCheck->GetValue()) { // commit immediately onCommit(ev); } else { _modifiedText->SetLabel (wxT("* modified *")); } } } else { ev.Skip(); } } void FTprocOrderDialog::onAddButton(wxCommandEvent & ev) { // append selected procmods from source wxListItem item; item.SetColumn(0); item.SetMask (wxLIST_MASK_TEXT|wxLIST_MASK_DATA); long itemi = -1; bool didsomething = false; for ( ;; ) { itemi = _sourceList->GetNextItem(itemi, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if ( itemi == -1 ) break; FTprocI * proc = (FTprocI *) _sourceList->GetItemData(itemi); if (proc) { item.SetText (wxString::FromAscii (proc->getName().c_str())); item.SetData ((unsigned)proc); item.SetId (_targetList->GetItemCount()); _targetList->InsertItem(item); _actions.push_back (ModAction (proc, -1 , _targetList->GetItemCount(), false)); didsomething = true; } } if (didsomething) { if (_autoCheck->GetValue()) { onCommit(ev); } else { _modifiedText->SetLabel (wxT("* modified *")); } } } freqtweak-0.7.2/src/FTprocOrderDialog.hpp0000644000175200017520000000437111226173741017317 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPROCORDERDIALOG_HPP__ #define __FTPROCORDERDIALOG_HPP__ #include using namespace std; #include #include "FTtypes.hpp" class FTprocI; class FTmainwin; class wxListCtrl; class FTprocOrderDialog : public wxFrame { public: // ctor(s) FTprocOrderDialog(FTmainwin * parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(400,600), long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxT("ProcOrderDialog")); virtual ~FTprocOrderDialog(); void refreshState(); protected: class ModAction { public: ModAction (FTprocI *pm, int frm , int toi, bool rem) : from(frm), to(toi), remove(rem), procmod(pm) {} ModAction (const ModAction & o) : from(o.from), to(o.to), remove(o.remove), procmod(o.procmod) {} int from; int to; bool remove; FTprocI * procmod; }; void init(); void onClose(wxCloseEvent & ev); void onCommit(wxCommandEvent & ev); void onSize(wxSizeEvent &ev); void onPaint(wxPaintEvent &ev); void onTargetButtons(wxCommandEvent & ev); void onAddButton(wxCommandEvent & ev); void onAutoCheck (wxCommandEvent &ev); wxListCtrl * _sourceList; wxListCtrl * _targetList; wxCheckBox * _autoCheck; wxStaticText * _modifiedText; FTmainwin * _mainwin; list _actions; bool _justResized; int _lastSelected; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; #endif freqtweak-0.7.2/src/FTprocessPath.cpp0000644000175200017520000000644411226173741016531 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #if HAVE_CONFIG_H #include #endif #include #include #include "FTprocessPath.hpp" #include "FTdspManager.hpp" #include "FTspectralEngine.hpp" #include "FTprocI.hpp" #include "RingBuffer.hpp" FTprocessPath::FTprocessPath() : _maxBufsize(16384), _sampleRate(44100), _specEngine(0), _readyToDie(false), _id(0) { // construct lockfree ringbufer _inputFifo = new RingBuffer(sizeof(sample_t) * FT_FIFOLENGTH); _outputFifo = new RingBuffer(sizeof(sample_t) * FT_FIFOLENGTH); initSpectralEngine(); } FTprocessPath::~FTprocessPath() { printf ("$#$#$#$#$ processpath \n"); delete _inputFifo; delete _outputFifo; if (_specEngine) delete _specEngine; } void FTprocessPath::initSpectralEngine() { _specEngine = new FTspectralEngine(); // load all dsp modules from dsp manager and put them in FTdspManager::ModuleList mlist; FTdspManager::instance()->getAvailableModules (mlist); FTdspManager::ModuleList::iterator mod = mlist.begin(); for (; mod != mlist.end(); ++mod) { if (!(*mod)->useAsDefault()) continue; FTprocI * newmod = (*mod)->clone(); newmod->initialize(); _specEngine->appendProcessorModule (newmod); } } void FTprocessPath::setId (int id) { _id = id; if (_specEngine) _specEngine->setId (id); } /** * This will get called from the jack thread */ void FTprocessPath::processData (sample_t * inbuf, sample_t *outbuf, nframes_t nframes) { bool good; if (_specEngine->getBypassed()) { if (_specEngine->getMuted()) { memset (outbuf, 0, sizeof(sample_t) * nframes); } else if (inbuf != outbuf) { memcpy (outbuf, inbuf, sizeof(sample_t) * nframes); } } else { // copy data from inbuf to the lock free fifo at write pointer if (_inputFifo->write_space() >= (nframes * sizeof(sample_t))) { _inputFifo->write ((char *) inbuf, sizeof(sample_t) * nframes); } else { //fprintf(stderr, "BLAH! Can't write into input fifo!\n"); } // DO SPECTRAL PROCESSING good = _specEngine->processNow (this); // copy data from fifo at read pointer into outbuf if (good && _outputFifo->read_space() >= (nframes * sizeof(sample_t))) { _outputFifo->read ((char *) outbuf, sizeof(sample_t) * nframes); if (_specEngine->getMuted()) { memset (outbuf, 0, sizeof(sample_t) * nframes); } } else { //fprintf(stderr, "BLAH! Can't read enough data from output fifo!\n"); if (_specEngine->getMuted()) { memset (outbuf, 0, sizeof(sample_t) * nframes); } else { memcpy (outbuf, inbuf, sizeof(sample_t) * nframes); } } } } freqtweak-0.7.2/src/FTprocessPath.hpp0000644000175200017520000000345411226173741016534 0ustar develdevel/* ** Copyright (C) 2002 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPROCESSPATH_HPP__ #define __FTPROCESSPATH_HPP__ #include "FTtypes.hpp" class RingBuffer; class FTspectralEngine; class FTprocessPath { public: FTprocessPath(); virtual ~FTprocessPath(); void setId (int id); int getId () { return _id; } void setMaxBufsize (nframes_t bsize) { _maxBufsize = bsize; } void setSampleRate (nframes_t srate) { _sampleRate = srate; } //void setSpectralEngine (FTspectralEngine * sengine) { _specEngine = sengine; } FTspectralEngine * getSpectralEngine () { return _specEngine; } void processData (sample_t *inbuf, sample_t *outbuf, nframes_t nframes); RingBuffer * getInputFifo() { return _inputFifo; } RingBuffer * getOutputFifo() { return _outputFifo; } bool getReadyToDie() { return _readyToDie; } void setReadyToDie(bool flag) { _readyToDie = flag; } protected: void initSpectralEngine(); nframes_t _maxBufsize; nframes_t _sampleRate; RingBuffer * _inputFifo; RingBuffer * _outputFifo; FTspectralEngine * _specEngine; bool _readyToDie; int _id; }; #endif freqtweak-0.7.2/src/FTmodulatorGui.cpp0000644000175200017520000004526211226174763016717 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include #include "FTmodulatorGui.hpp" #include "FTmodulatorI.hpp" #include "FTspectralEngine.hpp" #include "FTioSupport.hpp" #include "FTprocessPath.hpp" #include "FTprocI.hpp" using namespace SigC; enum { ID_RemoveButton = 8000, ID_AttachButton, ID_ChannelButton, ID_DetachAll, ID_AttachAll, ID_ModUserName, ID_BypassCheck }; enum { ID_ControlBase = 10000, ID_SpecModBase = 11000, ID_ChannelBase = 12000 }; class FTmodControlObject : public wxObject { public: FTmodControlObject(FTmodulatorI::Control *ctrl) : control(ctrl) , slider(0), textctrl(0), choice(0), checkbox(0) {} FTmodulatorI::Control * control; wxSlider * slider; wxTextCtrl * textctrl; wxChoice * choice; wxCheckBox * checkbox; }; class FTspecmodObject : public wxObject { public: FTspecmodObject(int chan, int mi, int fi) : channel(chan), modIndex(mi), filtIndex(fi) {} int channel; int modIndex; int filtIndex; }; class FTchannelObject : public wxObject { public: FTchannelObject(int chan) : channel(chan) {} int channel; }; BEGIN_EVENT_TABLE(FTmodulatorGui, wxPanel) EVT_BUTTON(ID_RemoveButton, FTmodulatorGui::onRemoveButton) EVT_BUTTON(ID_AttachButton, FTmodulatorGui::onAttachButton) EVT_BUTTON(ID_ChannelButton, FTmodulatorGui::onChannelButton) EVT_CHECKBOX(ID_BypassCheck, FTmodulatorGui::onBypassButton) EVT_TEXT_ENTER (ID_ModUserName, FTmodulatorGui::onTextEnter) EVT_MENU (ID_AttachAll, FTmodulatorGui::onAttachMenu) EVT_MENU (ID_DetachAll, FTmodulatorGui::onAttachMenu) END_EVENT_TABLE() FTmodulatorGui::FTmodulatorGui (FTioSupport * iosup, FTmodulatorI *mod, wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style , const wxString& name) : wxPanel(parent, id, pos, size, style, name), _modulator (mod), _iosup(iosup), _popupMenu(0), _channelPopupMenu(0) { init(); } FTmodulatorGui::~FTmodulatorGui() { // cerr << "MODGUI destructor" << endl; } void FTmodulatorGui::init() { wxBoxSizer * mainSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer * topSizer = new wxBoxSizer(wxHORIZONTAL); // wxBoxSizer *tmpsizer, *tmpsizer2; wxStaticText * stattext; stattext = new wxStaticText(this, -1, wxString::FromAscii(_modulator->getName().c_str()), wxDefaultPosition, wxSize(-1, -1)); stattext->SetFont(wxFont(stattext->GetFont().GetPointSize(), wxDEFAULT, wxNORMAL, wxBOLD)); topSizer->Add (stattext, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 2); _nameText = new wxTextCtrl (this, ID_ModUserName, wxString::FromAscii(_modulator->getUserName().c_str()), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); topSizer->Add (_nameText, 1, wxALL|wxALIGN_CENTRE_VERTICAL, 2); wxCheckBox * bypassCheck = new wxCheckBox(this, ID_BypassCheck, wxT("Bypass")); bypassCheck->SetValue(_modulator->getBypassed()); topSizer->Add (bypassCheck, 0, wxTOP|wxBOTTOM|wxALIGN_CENTRE_VERTICAL, 2); // wxButton * chanButton = new wxButton(this, ID_ChannelButton, wxT("Source..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); // topSizer->Add (chanButton, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 2); wxButton * attachButton = new wxButton(this, ID_AttachButton, wxT("Attach..."), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); topSizer->Add (attachButton, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 2); wxButton * removeButton = new wxButton(this, ID_RemoveButton, wxT("X"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); topSizer->Add (removeButton, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 2); mainSizer->Add (topSizer, 0, wxEXPAND|wxALL, 2); wxBoxSizer * controlSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer * rowsizer; int ctrlid = ID_ControlBase; int textwidth = 70; // get controls FTmodulatorI::ControlList controls; _modulator->getControls (controls); for (FTmodulatorI::ControlList::iterator ctrliter = controls.begin(); ctrliter != controls.end(); ++ctrliter) { FTmodulatorI::Control * ctrl = (FTmodulatorI::Control *) *ctrliter; wxString unitstr = wxString::Format(wxT("%s"), ctrl->getName().c_str()); if (!ctrl->getUnits().empty()) { unitstr += wxString::Format(wxT(" [%s]"), ctrl->getUnits().c_str()); } if (ctrl->getType() == FTmodulatorI::Control::BooleanType) { // make a checkbox wxCheckBox * checkb = new wxCheckBox(this, ctrlid, unitstr); FTmodControlObject * ctrlobj = new FTmodControlObject(ctrl); ctrlobj->checkbox = checkb; Connect( ctrlid, wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &FTmodulatorGui::onCheckboxChanged, ctrlobj); controlSizer->Add (checkb, 0, wxEXPAND|wxALL, 2); } else if (ctrl->getType() == FTmodulatorI::Control::IntegerType) { // make a slider and spinbox for now rowsizer = new wxBoxSizer(wxHORIZONTAL); stattext = new wxStaticText(this, -1, unitstr); rowsizer->Add (stattext, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 2); int currval = 0; int minval=0,maxval=1; ctrl->getValue(currval); ctrl->getBounds(minval, maxval); wxSlider * slider = new wxSlider(this, ctrlid, currval, minval, maxval); rowsizer->Add (slider, 1, wxALL|wxALIGN_CENTRE_VERTICAL, 2); ctrlid++; wxTextCtrl * textctrl = new wxTextCtrl(this, ctrlid, wxString::Format(wxT("%d"), currval), wxDefaultPosition, wxSize(textwidth, -1), wxTE_PROCESS_ENTER|wxTE_RIGHT); rowsizer->Add (textctrl, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 2); FTmodControlObject * ctrlobj = new FTmodControlObject(ctrl); ctrlobj->slider = slider; ctrlobj->textctrl = textctrl; Connect( slider->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxScrollEventFunction) &FTmodulatorGui::onSliderChanged, ctrlobj); ctrlobj= new FTmodControlObject(ctrl); ctrlobj->slider = slider; ctrlobj->textctrl = textctrl; Connect( textctrl->GetId(), wxEVT_COMMAND_TEXT_ENTER, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &FTmodulatorGui::onTextEnter, ctrlobj); controlSizer->Add (rowsizer, 0, wxEXPAND|wxALL, 2); } else if (ctrl->getType() == FTmodulatorI::Control::FloatType) { // make a slider and spinbox for now rowsizer = new wxBoxSizer(wxHORIZONTAL); stattext = new wxStaticText(this, -1, unitstr); rowsizer->Add (stattext, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 2); float currval = 0; float minval=0,maxval=1; int calcval = 0; ctrl->getValue(currval); ctrl->getBounds(minval, maxval); // we'll always have slider values between 0 and 1000 for now calcval = (int) (((currval-minval) / (maxval - minval)) * 1000); wxSlider * slider = new wxSlider(this, ctrlid, (int) calcval, 0, 1000); rowsizer->Add (slider, 1, wxALL|wxALIGN_CENTRE_VERTICAL, 2); ctrlid++; wxTextCtrl * textctrl = new wxTextCtrl(this, ctrlid, wxString::Format(wxT("%.6g"), currval), wxDefaultPosition, wxSize(textwidth, -1), wxTE_PROCESS_ENTER|wxTE_RIGHT); rowsizer->Add (textctrl, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 2); FTmodControlObject * ctrlobj = new FTmodControlObject(ctrl); ctrlobj->slider = slider; ctrlobj->textctrl = textctrl; Connect( slider->GetId(), wxEVT_SCROLL_THUMBTRACK, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxScrollEventFunction) &FTmodulatorGui::onSliderChanged, ctrlobj); ctrlobj= new FTmodControlObject(ctrl); ctrlobj->slider = slider; ctrlobj->textctrl = textctrl; Connect( textctrl->GetId(), wxEVT_COMMAND_TEXT_ENTER, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &FTmodulatorGui::onTextEnter, ctrlobj); controlSizer->Add (rowsizer, 0, wxEXPAND|wxALL, 2); } else if (ctrl->getType() == FTmodulatorI::Control::EnumType) { // use a wxChoice rowsizer = new wxBoxSizer(wxHORIZONTAL); stattext = new wxStaticText(this, -1, unitstr); rowsizer->Add (stattext, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 2); string currval; list vallist; ctrl->getValue(currval); ctrl->getEnumStrings (vallist); wxChoice * choice = new wxChoice(this, ctrlid, wxDefaultPosition, wxDefaultSize, 0, 0); for (list::iterator citer = vallist.begin(); citer != vallist.end(); ++citer) { choice->Append (wxString::FromAscii((*citer).c_str())); } choice->SetStringSelection (wxString::FromAscii(currval.c_str())); rowsizer->Add (choice, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 2); FTmodControlObject * ctrlobj = new FTmodControlObject(ctrl); ctrlobj->choice = choice; Connect( ctrlid, wxEVT_COMMAND_CHOICE_SELECTED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &FTmodulatorGui::onChoiceChanged, ctrlobj); controlSizer->Add (rowsizer, 0, wxEXPAND|wxALL, 2); } ctrlid++; } //controlSizer->Add(new wxButton(this, -1, wxT("BIG TEST"), wxDefaultPosition, wxSize(120, 90)), // 1, wxEXPAND|wxALL, 2); _modulator->GoingAway.connect ( slot (*this, &FTmodulatorGui::onModulatorDeath)); mainSizer->Add (controlSizer, 1, wxEXPAND|wxALL, 2); SetAutoLayout( TRUE ); mainSizer->Fit( this ); mainSizer->SetSizeHints( this ); SetSizer( mainSizer ); } void FTmodulatorGui::refreshMenu() { if (_popupMenu) { delete _popupMenu; } _popupMenu = new wxMenu(); int itemid = ID_SpecModBase; _popupMenu->Append (ID_DetachAll, wxT("Detach All")); _popupMenu->Append (ID_AttachAll, wxT("Attach All")); FTprocessPath * procpath; for (int i=0; i < _iosup->getActivePathCount(); ++i) { procpath = _iosup->getProcessPath(i); if (procpath) { FTspectralEngine *engine = procpath->getSpectralEngine(); _popupMenu->AppendSeparator(); _popupMenu->Append (itemid, wxString::Format(wxT("Channel %d"), i+1)); _popupMenu->Enable (itemid, false); itemid++; // go through all the spectrum modifiers in the engine vector procmods; engine->getProcessorModules (procmods); for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); for (unsigned int m=0; m < filts.size(); ++m) { _popupMenu->AppendCheckItem (itemid, wxString::FromAscii (filts[m]->getName().c_str())); if (_modulator->hasSpecMod (filts[m])) { _popupMenu->Check (itemid, true); } Connect( itemid, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &FTmodulatorGui::onAttachMenu, (wxObject *) new FTspecmodObject(i, n, m)); itemid++; } } } } } void FTmodulatorGui::onAttachMenu (wxCommandEvent & ev) { int id = ev.GetId(); if (id == ID_AttachAll) { // go through every one and add it FTprocessPath * procpath; for (int i=0; i < _iosup->getActivePathCount(); ++i) { procpath = _iosup->getProcessPath(i); if (procpath) { FTspectralEngine *engine = procpath->getSpectralEngine(); vector procmods; engine->getProcessorModules (procmods); for (unsigned int n=0; n < procmods.size(); ++n) { FTprocI *pm = procmods[n]; vector filts; pm->getFilters (filts); for (unsigned int m=0; m < filts.size(); ++m) { _modulator->addSpecMod (filts[m]); } } } } } else if (id == ID_DetachAll) { _modulator->clearSpecMods(); } else { // a filter menu item FTspecmodObject * smo = (FTspecmodObject *) ev.m_callbackUserData; FTprocI * procmod; FTspectrumModifier * specmod; FTprocessPath * procpath; FTspectralEngine * engine; if (smo && (procpath = _iosup->getProcessPath(smo->channel)) && (engine = procpath->getSpectralEngine()) && (procmod = engine->getProcessorModule(smo->modIndex)) && (specmod = procmod->getFilter(smo->filtIndex))) { if (ev.IsChecked()) { _modulator->addSpecMod (specmod); } else { _modulator->removeSpecMod (specmod); } } } } void FTmodulatorGui::onRemoveButton (wxCommandEvent & ev) { // remove our own dear mod //cerr << "on remove" << endl; RemovalRequest (); // emit signal // remove from old engine for (int i=0; i < _iosup->getActivePathCount(); ++i) { FTprocessPath * ppath = _iosup->getProcessPath(i); if (ppath) { ppath->getSpectralEngine()->removeModulator (_modulator); } } //cerr << "post remove" << endl; _modulator = 0; } void FTmodulatorGui::onModulatorDeath (FTmodulatorI * mod) { // cerr << "modguiuui: mod death" << endl; _modulator = 0; } void FTmodulatorGui::onAttachButton (wxCommandEvent & ev) { wxWindow * source = (wxWindow *) ev.GetEventObject(); wxRect pos = source->GetRect(); refreshMenu(); PopupMenu(_popupMenu, pos.x, pos.y + pos.height); } void FTmodulatorGui::onSliderChanged(wxScrollEvent &ev) { wxSlider * slider = (wxSlider *) ev.GetEventObject(); FTmodControlObject * obj = (FTmodControlObject *) ev.m_callbackUserData; FTmodulatorI::Control * ctrl; if (obj && (ctrl = obj->control)) { if (ctrl->getType() == FTmodulatorI::Control::IntegerType) { int currval = slider->GetValue(); ctrl->setValue(currval); //cerr << "slider int changed for " << ctrl->getName() << ": new val = " << currval << endl; if (obj->textctrl) { obj->textctrl->SetValue(wxString::Format(wxT("%d"), currval)); } } else if (ctrl->getType() == FTmodulatorI::Control::FloatType) { float minval,maxval; ctrl->getBounds(minval, maxval); float currval = (slider->GetValue() / 1000.0) * (maxval - minval) + minval; ctrl->setValue (currval); //cerr << "slider float changed for " << ctrl->getName() << ": new val = " << currval << endl; if (obj->textctrl) { obj->textctrl->SetValue(wxString::Format(wxT("%.6g"), currval)); } } } } void FTmodulatorGui::onChoiceChanged(wxCommandEvent &ev) { wxChoice * choice = (wxChoice *) ev.GetEventObject(); FTmodControlObject * obj = (FTmodControlObject *) ev.m_callbackUserData; FTmodulatorI::Control * ctrl; if (obj && (ctrl = obj->control)) { ctrl->setValue (string(static_cast (choice->GetStringSelection().mb_str()))); //cerr << " choice changed for " << ctrl->getName() << ": new val = " << choice->GetStringSelection().c_str() << endl; } } void FTmodulatorGui::onCheckboxChanged(wxCommandEvent &ev) { FTmodControlObject * obj = (FTmodControlObject *) ev.m_callbackUserData; FTmodulatorI::Control * ctrl; if (obj && (ctrl = obj->control) && obj->checkbox) { ctrl->setValue ((bool) obj->checkbox->GetValue()); // cerr << " checkbox changed for " << ctrl->getName() << ": new val = " << obj->checkbox->GetValue() << endl; } } void FTmodulatorGui::refreshChannelMenu () { if (_channelPopupMenu) { delete _channelPopupMenu; } _channelPopupMenu = new wxMenu(); int itemid = ID_ChannelBase; FTprocessPath * procpath; for (int i=0; i < _iosup->getActivePathCount(); ++i) { procpath = _iosup->getProcessPath(i); if (procpath) { _channelPopupMenu->AppendCheckItem (itemid, wxString::Format(wxT("Channel %d"), i+1)); if (procpath->getSpectralEngine()->hasModulator(_modulator)) { _channelPopupMenu->Check (itemid, true); } Connect( itemid, wxEVT_COMMAND_MENU_SELECTED, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &FTmodulatorGui::onChannelMenu, (wxObject *) new FTchannelObject(i)); itemid++; } } } void FTmodulatorGui::onChannelMenu (wxCommandEvent &ev) { FTchannelObject * smo = (FTchannelObject *) ev.m_callbackUserData; FTprocessPath * procpath; if (smo && (procpath = _iosup->getProcessPath(smo->channel)) && (!procpath->getSpectralEngine()->hasModulator(_modulator))) { // only if engine doesn't already contain it // cerr << "on channel menu" << endl; // remove from old engine without destroying for (int i=0; i < _iosup->getActivePathCount(); ++i) { FTprocessPath * ppath = _iosup->getProcessPath(i); if (ppath) { ppath->getSpectralEngine()->removeModulator (_modulator, false); } } // add to new one procpath->getSpectralEngine()->appendModulator(_modulator); } } void FTmodulatorGui::onChannelButton (wxCommandEvent &ev) { wxWindow * source = (wxWindow *) ev.GetEventObject(); wxRect pos = source->GetRect(); refreshChannelMenu(); PopupMenu(_channelPopupMenu, pos.x, pos.y + pos.height); } void FTmodulatorGui::onTextEnter (wxCommandEvent &ev) { if (ev.GetId() == ID_ModUserName) { string name = static_cast (_nameText->GetValue().fn_str()); _modulator->setUserName (name); // cerr << "name changed to :" << name << endl; } else { FTmodControlObject * cobj = (FTmodControlObject *) ev.m_callbackUserData; wxString tmpstr; long tmplong; double tmpfloat; if (cobj && cobj->textctrl) { tmpstr = cobj->textctrl->GetValue(); if (cobj->control->getType() == FTmodulatorI::Control::IntegerType) { int lb,ub,currval; cobj->control->getBounds(lb, ub); cobj->control->getValue(currval); if (tmpstr.ToLong (&tmplong) && cobj->control->setValue ((int) tmplong) && (float)tmpfloat >= lb && (float)tmpfloat <= ub) { // change slider too cobj->slider->SetValue (tmplong); } else { cobj->textctrl->SetValue(wxString::Format(wxT("%d"), currval)); } } else if (cobj->control->getType() == FTmodulatorI::Control::FloatType) { float lb,ub,currval; cobj->control->getBounds(lb, ub); cobj->control->getValue(currval); if (tmpstr.ToDouble (&tmpfloat) && cobj->control->setValue ((float) tmpfloat) && (float)tmpfloat >= lb && (float)tmpfloat <= ub) { // change slider too int slidval = (int) ((tmpfloat - lb) / (ub-lb) * 1000.0); cobj->slider->SetValue (slidval); } else { cobj->textctrl->SetValue(wxString::Format(wxT("%.6g"), currval)); } } } } } void FTmodulatorGui::onBypassButton (wxCommandEvent &ev) { if (_modulator->getBypassed() != ev.IsChecked()) { _modulator->setBypassed (ev.IsChecked()); } } freqtweak-0.7.2/src/FTmodulatorGui.hpp0000644000175200017520000000456311226173741016716 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTMODULATORGUI_HPP__ #define __FTMODULATORGUI_HPP__ #include #include #include #include "FTtypes.hpp" //#include "FTmodulatorI.hpp" #include "LockMonitor.hpp" #include "FTspectrumModifier.hpp" class FTioSupport; class FTmodulatorI; class FTspectralEngine; class FTmodulatorGui : public wxPanel, public SigC::Object { public: FTmodulatorGui(FTioSupport * iosup, FTmodulatorI * mod, wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxRAISED_BORDER, const wxString& name = wxT("ModulatorGui")); virtual ~FTmodulatorGui(); SigC::Signal0 RemovalRequest; protected: void init(); void onCheckboxChanged(wxCommandEvent &ev); void onSliderChanged(wxScrollEvent &ev); void onChoiceChanged(wxCommandEvent &ev); void onRemoveButton (wxCommandEvent & ev); void onAttachButton (wxCommandEvent & ev); void onChannelButton (wxCommandEvent & ev); void onTextEnter (wxCommandEvent &ev); void onBypassButton (wxCommandEvent &ev); void onModulatorDeath (FTmodulatorI * mod); void onAttachMenu (wxCommandEvent &ev); void onChannelMenu (wxCommandEvent &ev); void refreshMenu(); void refreshChannelMenu(); FTmodulatorI * _modulator; FTioSupport * _iosup; wxTextCtrl * _nameText; wxMenu * _popupMenu; wxMenu * _channelPopupMenu; // std::map _controlMap; private: // any class wishing to process wxWindows events must use this macro DECLARE_EVENT_TABLE() }; #endif freqtweak-0.7.2/src/FTprocDelay.cpp0000644000175200017520000001230011226173741016144 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTprocDelay.hpp" #include "RingBuffer.hpp" FTprocDelay::FTprocDelay (nframes_t samprate, unsigned int fftn) : FTprocI("Delay", samprate, fftn), _delayFilter(0), _feedbackFilter(0), _frameFifo(0), _maxDelay(2.5) { _confname = "Delay"; } FTprocDelay::FTprocDelay (const FTprocDelay & other) : FTprocI (other._name, other._sampleRate, other._fftN), _delayFilter(0), _feedbackFilter(0), _frameFifo(0), _maxDelay(2.5) { _confname = "Delay"; } void FTprocDelay::initialize() { // create filters _delayFilter = new FTspectrumModifier("Delay", "delay", 0, FTspectrumModifier::TIME_MODIFIER, DELAY_SPECMOD, _fftN/2, 0.0); _delayFilter->setRange(0.0, _maxDelay); _feedbackFilter = new FTspectrumModifier("D Feedback", "feedback", 1, FTspectrumModifier::UNIFORM_MODIFIER, FEEDB_SPECMOD, _fftN/2, 0.0); _feedbackFilter->setRange(0.0, 1.0); setMaxDelay(_maxDelay); _filterlist.push_back(_delayFilter); _filterlist.push_back(_feedbackFilter); _inited = true; } FTprocDelay::~FTprocDelay() { if (!_inited) return; delete _frameFifo; _filterlist.clear(); delete _delayFilter; delete _feedbackFilter; } void FTprocDelay::reset() { // flush FIFOs _frameFifo->reset(); _frameFifo->mem_set(0); } void FTprocDelay::setMaxDelay(float secs) { // THIS MUST NOT BE CALLED WHILE WE ARE ACTIVATED! if (secs <= 0.0) return; unsigned long maxsamples = 1; _maxDelay = secs; _maxDelaySamples = (unsigned long) (_maxDelay * _sampleRate) * sizeof(sample_t); // we need to force this to the next bigger power of 2 for the memory allocation while (maxsamples < _maxDelaySamples) { maxsamples <<= 1; } if (_frameFifo) delete _frameFifo; //printf ("using %lu for maxsamples\n", maxsamples); // this is a big boy containing the frequency data frames over time _frameFifo = new RingBuffer( maxsamples * sizeof(fft_data) ); // adjust time filter if (_delayFilter) { _delayFilter->setRange (0.0, _maxDelay); _delayFilter->reset(); } } void FTprocDelay::process (fft_data *data, unsigned int fftn) { if (!_inited) return; if (_delayFilter->getBypassed()) { _frameFifo->write ( (char *) data, sizeof(fft_data) * fftn); _frameFifo->read( (char *) data, sizeof(fft_data) * fftn); // RETURNS HERE return; } float *delay = _delayFilter->getValues(); float *feedb = _feedbackFilter->getValues(); float feedback = 0.0; bool bypassfeed = _feedbackFilter->getBypassed(); float mindelay = _delayFilter->getMin(); float maxdelay = _delayFilter->getMax(); float thisdelay; float *rdest = 0, *idest = 0; float *rcurr = 0, *icurr = 0; nframes_t bshift, fshift; int fftn2 = (fftn+1) >> 1; //RingBuffer::rw_vector readvec[2]; RingBuffer::rw_vector wrvec[2]; _frameFifo->get_write_vector(wrvec); for (int i = 0; i < fftn2-1; i++) { if (bypassfeed) { feedback = 0.0; } else { feedback = feedb[i] < 0.0 ? 0.0 : feedb[i]; } if (delay[i] > maxdelay) { thisdelay = maxdelay; } else if (delay[i] <= mindelay) { // force feedback to 0 if no delay feedback = 0.0; thisdelay = mindelay; } else { thisdelay = delay[i]; } // frames to shift fshift = ((nframes_t)(_sampleRate * thisdelay * sizeof(sample_t))) / fftn; //nframes_t bshift = fshift * fftn * sizeof(sample_t); //printf ("bshift %Zd wrvec[0]=%d\n", bshift, wrvec[0].len); // byte offset to start of frame //bshift = fshift * fftn * sizeof(sample_t); bshift = fshift * fftn * sizeof(sample_t); // we know the next frame is in the first segment of the FIFO // because our FIFO size is always shifted one frame at a time rcurr = (float * ) (wrvec[0].buf + i*sizeof(sample_t)); icurr = (float * ) (wrvec[0].buf + (fftn-i)*sizeof(sample_t)); if (wrvec[0].len > bshift) { rdest = (float *) (wrvec[0].buf + bshift + i*sizeof(sample_t)); idest = (float *) (wrvec[0].buf + bshift + (fftn-i)*sizeof(sample_t)); } else if (wrvec[1].len) { bshift -= wrvec[0].len; rdest = (float *) (wrvec[1].buf + bshift + i*sizeof(sample_t)); idest = (float *) (wrvec[1].buf + bshift + (fftn-i)*sizeof(sample_t)); } else { printf ("BLAHHALALAHLA\n"); continue; } *rdest = data[i] + (*rcurr)*feedback; if (i > 0) { *idest = data[fftn-i] + (*icurr)*feedback; } } // advance it _frameFifo->write_advance(fftn * sizeof(fft_data)); //_frameFifo->write ( (char *) data, sizeof(fft_data) * fftn); // read data into output _frameFifo->read( (char *) data, sizeof(fft_data) * fftn); } freqtweak-0.7.2/src/FTprocDelay.hpp0000644000175200017520000000307511226173741016162 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPROCDELAY_HPP__ #define __FTPROCDELAY_HPP__ #include "FTprocI.hpp" class RingBuffer; class FTprocDelay : public FTprocI { public: FTprocDelay (nframes_t samprate, unsigned int fftn); FTprocDelay (const FTprocDelay & other); virtual ~FTprocDelay(); FTprocI * clone() { return new FTprocDelay(*this); } void initialize(); void process (fft_data *data, unsigned int fftn); void reset(); void setMaxDelay(float secs); protected: FTspectrumModifier * _delayFilter; FTspectrumModifier * _feedbackFilter; // this is a very large ringbuffer // used to store the fft results over time // each frame is stored sequentially. // the length is determined by the maximum delay time RingBuffer *_frameFifo; unsigned long _maxDelaySamples; float _maxDelay; }; #endif freqtweak-0.7.2/src/FTprocGate.cpp0000644000175200017520000000513611226173741015777 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTprocGate.hpp" #include "FTutils.hpp" FTprocGate::FTprocGate (nframes_t samprate, unsigned int fftn) : FTprocI("Gate", samprate, fftn) , _dbAdjust(-37.0) { _confname = "Gate"; } FTprocGate::FTprocGate (const FTprocGate & other) : FTprocI (other._name, other._sampleRate, other._fftN) , _dbAdjust(other._dbAdjust) { _confname = "Gate"; } void FTprocGate::initialize() { // create filters _filter = new FTspectrumModifier("Gate Bottom", "gate", 0, FTspectrumModifier::DB_MODIFIER, GATE_SPECMOD, _fftN/2, -90.0); _filter->setRange(-90.0, 0.0); //_gateFilter->reset(); _filter->setBypassed(true); // by default _invfilter = new FTspectrumModifier("Gate", "inverse_gate", 0, FTspectrumModifier::DB_MODIFIER, GATE_SPECMOD, _fftN/2, 0.0); _invfilter->setRange(-90.0, 0.0); _invfilter->setBypassed(true); // by default _filterlist.push_back(_invfilter); _filterlist.push_back(_filter); _inited = true; } FTprocGate::~FTprocGate() { if (!_inited) return; _filterlist.clear(); delete _filter; delete _invfilter; } void FTprocGate::process (fft_data *data, unsigned int fftn) { if (!_inited || _filter->getBypassed()) { return; } float *filter = _filter->getValues(); float *invfilter = _invfilter->getValues(); float power; float db; int fftn2 = (fftn+1) >> 1; // only allow data through if power is above threshold power = (data[0] * data[0]); db = FTutils::powerLogScale (power, 0.0000000) + _dbAdjust; // total fudge factors if (db < filter[0] || db > invfilter[0]) { data[0] = 0.0; } for (int i = 1; i < fftn2-1; i++) { power = (data[i] * data[i]) + (data[fftn-i] * data[fftn-i]); db = FTutils::powerLogScale (power, 0.0000000) + _dbAdjust; // total fudge factors if (db < filter[i] || db > invfilter[i]) { //printf ("db %g\n", db); data[i] = data[fftn-i] = 0.0; } } } freqtweak-0.7.2/src/FTprocGate.hpp0000644000175200017520000000237111226173741016002 0ustar develdevel/* ** Copyright (C) 2003 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTPROCGATE_HPP__ #define __FTPROCGATE_HPP__ #include "FTprocI.hpp" class FTprocGate : public FTprocI { public: FTprocGate(nframes_t samprate, unsigned int fftn); FTprocGate (const FTprocGate & other); virtual ~FTprocGate(); FTprocI * clone() { return new FTprocGate(*this); } void initialize(); void process (fft_data *data, unsigned int fftn); protected: FTspectrumModifier * _filter; FTspectrumModifier * _invfilter; float _dbAdjust; }; #endif freqtweak-0.7.2/src/FTmodRotateLFO.cpp0000644000175200017520000001372211226173741016532 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #include "FTmodRotateLFO.hpp" #include "FTutils.hpp" #include #include #include using namespace std; using namespace PBD; FTmodRotateLFO::FTmodRotateLFO (nframes_t samplerate, unsigned int fftn) : FTmodulatorI ("RotateLFO", "Rotate LFO", samplerate, fftn) { } FTmodRotateLFO::FTmodRotateLFO (const FTmodRotateLFO & other) : FTmodulatorI ("RotateLFO", "Rotate LFO", other._sampleRate, other._fftN) { } void FTmodRotateLFO::initialize() { _lastframe = 0; _lastshift = 0; _rate = new Control (Control::FloatType, "rate", "Rate", "Hz"); _rate->_floatLB = 0.0; _rate->_floatUB = 20.0; _rate->setValue (0.0f); _controls.push_back (_rate); _depth = new Control (Control::FloatType, "depth", "Depth", "Hz"); _depth->_floatLB = 0; _depth->_floatUB = (float) _sampleRate/2; _depth->setValue (_depth->_floatUB); _controls.push_back (_depth); _lfotype = new Control (Control::EnumType, "lfo_type", "LFO Type", ""); _lfotype->_enumList.push_back("Sine"); _lfotype->_enumList.push_back("Triangle"); _lfotype->_enumList.push_back("Square"); _lfotype->setValue (string("Sine")); _controls.push_back (_lfotype); _minfreq = new Control (Control::FloatType, "min_freq", "Min Freq", "Hz"); _minfreq->_floatLB = 0.0; _minfreq->_floatUB = _sampleRate / 2; _minfreq->setValue (_minfreq->_floatLB); _controls.push_back (_minfreq); _maxfreq = new Control (Control::FloatType, "max_freq", "Max Freq", "Hz"); _maxfreq->_floatLB = 0.0; _maxfreq->_floatUB = _sampleRate / 2; _maxfreq->setValue (_maxfreq->_floatUB); _controls.push_back (_maxfreq); _tmpfilt = new float[_fftN]; _inited = true; } FTmodRotateLFO::~FTmodRotateLFO() { if (!_inited) return; _controls.clear(); delete _rate; delete _depth; delete _lfotype; delete _minfreq; delete _maxfreq; } void FTmodRotateLFO::setFFTsize (unsigned int fftn) { _fftN = fftn; if (_inited) { delete _tmpfilt; _tmpfilt = new float[_fftN]; } } void FTmodRotateLFO::modulate (nframes_t current_frame, fft_data * fftdata, unsigned int fftn, sample_t * timedata, nframes_t nframes) { TentativeLockMonitor lm (_specmodLock, __LINE__, __FILE__); if (!lm.locked() || !_inited || _bypassed) return; float rate = 1.0; double currdev = 0.0; float ub,lb; float * filter; int len; int i,j; float minfreq, maxfreq; float depth = 1.0; int minbin, maxbin; double hzperbin; double current_secs; string shape; // in hz _rate->getValue (rate); _lfotype->getValue (shape); // in hz _depth->getValue (depth); _minfreq->getValue (minfreq); _maxfreq->getValue (maxfreq); if (minfreq >= maxfreq) { return; } hzperbin = _sampleRate / (double) fftn; // last_secs = _lastframe / (double) _sampleRate; current_secs = current_frame / (double) _sampleRate; int shiftval = 0; if (shape == "Sine") { currdev = (double) (FTutils::sine_wave (current_secs, (double) rate) * (depth * 0.5 / hzperbin)); } else if (shape == "Square") { currdev = (double) (FTutils::square_wave (current_secs, (double) rate) * (depth * 0.5 / hzperbin)); } else if (shape == "Triangle") { currdev = (double) (FTutils::triangle_wave (current_secs, (double) rate) * (depth * 0.5 / hzperbin)); } else { return; } shiftval = (int) (currdev - _lastshift); //cerr << "currdev: " << currdev << " depth: " << depth << " hzper: " << hzperbin << " shift: " << shiftval << endl; if (current_frame != _lastframe && shiftval != 0) { // fprintf (stderr, "shift at %lu : samps=%g s*c=%g s*e=%g \n", (unsigned long) current_frame, samps, (current_frame/samps), ((current_frame + nframes)/samps) ); for (SpecModList::iterator iter = _specMods.begin(); iter != _specMods.end(); ++iter) { FTspectrumModifier * sm = (*iter); if (sm->getBypassed()) continue; // cerr << "shiftval is: " << shiftval // << " hz/bin: " << hzperbin // << " rate: " << rate << endl; filter = sm->getValues(); sm->getRange(lb, ub); len = (int) sm->getLength(); minbin = (int) ((minfreq*2/ _sampleRate) * len); maxbin = (int) ((maxfreq*2/ _sampleRate) * len); len = maxbin - minbin; if (len <= 0) { continue; } int shiftbins = (abs(shiftval) % len) * (shiftval > 0 ? 1 : -1); // fprintf(stderr, "shifting %d %d:%d at %lu\n", shiftbins, minbin, maxbin, (unsigned long) current_frame); if (shiftbins > 0) { // shiftbins is POSITIVE, shift right // store last shiftbins for (i=maxbin-shiftbins; i < maxbin; i++) { _tmpfilt[i] = filter[i]; } for ( i=maxbin-1; i >= minbin + shiftbins; i--) { filter[i] = filter[i-shiftbins]; } for (j=maxbin-shiftbins, i=minbin; i < minbin + shiftbins; i++, j++) { filter[i] = _tmpfilt[j]; } } else if (shiftbins < 0) { // shiftbins is NEGATIVE, shift left // store last shiftbins // store first shiftbins for (i=minbin; i < minbin-shiftbins; i++) { _tmpfilt[i] = filter[i]; } for (i=minbin; i < maxbin + shiftbins; i++) { filter[i] = filter[i-shiftbins]; } for (j=minbin, i=maxbin+shiftbins; i < maxbin; i++, j++) { filter[i] = _tmpfilt[j]; } } sm->setDirty(true); } _lastframe = current_frame; _lastshift = (int) currdev; } } freqtweak-0.7.2/src/FTmodRotateLFO.hpp0000644000175200017520000000275011226173741016536 0ustar develdevel/* ** Copyright (C) 2004 Jesse Chappell ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program 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 General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** */ #ifndef __FTMODROTATELFO_HPP__ #define __FTMODROTATELFO_HPP__ #include "FTmodulatorI.hpp" class FTmodRotateLFO : public FTmodulatorI { public: FTmodRotateLFO(nframes_t samplerate, unsigned int fftn); FTmodRotateLFO (const FTmodRotateLFO & other); virtual ~FTmodRotateLFO(); FTmodulatorI * clone() { return new FTmodRotateLFO(*this); } void initialize(); void modulate (nframes_t current_frame, fft_data * fftdata, unsigned int fftn, sample_t * timedata, nframes_t nframes); void setFFTsize (unsigned int fftn); protected: Control * _rate; Control * _depth; Control * _lfotype; Control * _minfreq; Control * _maxfreq; nframes_t _lastframe; int _lastshift; float * _tmpfilt; }; #endif freqtweak-0.7.2/NEWS0000644000175200017520000000640711226173741013207 0ustar develdevelfreqtweak -- History of visible changes. Copyright (C) 2002-2004, Jesse Chappell See the end for copying conditions. Please send freqtweak bug reports to freqtweak-user@lists.sourceforge.net Version 0.6.1 -- 7 July 2004 * various fixes to satisfy compilers * modulator preset loading fixes * jack tmpdir option fix Version 0.6.0 -- 23 April 2004 * added filter Modulators, Rotate, Rotate LFO, Value LFO, and Randomize * minor bugfixes Version 0.5.3 * reworked all string handling to be compatible with unicode versions of wxGTK * 64bit portability fixes * added usage help Version 0.5.2 * fixed dialog closing problem, made them real windows * fixed compile problems for gcc 2.96 * added Compressor module * added EQ Boost module * now supports FFTW3 * manpage contributed by Enrique Arnuncio Version 0.5.1 * fixed terrible preset loading bug (when fft size was other than default) Version 0.5.0 * arbitrarily selectable and reorderable modules * preset blending feature * two new modules: limiter and warp * new preset format (conversion script included: ft_preset_convert.py) * internal design cleanup Version 0.4.8 * fixed preset loading crashing * no longer restores ports by default when loading presets, made it an option. Version 0.4.7 * fixed tempo=0 bug * new gcc and 64 bit fixes Version 0.4.6 * Many stability fixes * Grid and grid snap options * optional tempo based grid for delay time * THIS time I did finally fix the FFT changing problems! * Added adjustable max delay time levels (up to 20secs) * Pitch now uses semitones as units * Min/max legend text on plots. Version 0.4.5 * This time, I think I might have licked the changing FFT sizes problem! * now uses the alsa_pcm conventions from JACK 0.40 for default connections * added disconnect (from JACK) button to IO tab Version 0.4.4 * Now deactivates processing while switching FFT sizes. This should prevent JACK from kicking us out here. * Added ability to reconnect to JACK with a different basename, or just reconnect if we are kicked out. * Control-Alt left mouse draws arbitrary straight lines between initial click and current cursor. Also smoothed regular drawing. * More configure checks to ensure compiling against the float version of FFTW. Version 0.4.3 * This time, I think the main configuration problem people were having fixed. * Fixed empty preset Load and Store bugs * Added 4096 freq bin mode at Steve Harris' request. Version 0.4.2 * Didn't fix problem before... now it should be :) Version 0.4.1 * Fixed problem with wxWindows version inconsistencies related to wxListBox Version 0.4 * Initial release. ------------------------------------------------------- Copying information: Copyright (C) 2002-2003, Jesse Chappell Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that the copyright notice and this permission notice are preserved, thus giving the recipient permission to redistribute in turn. Permission is granted to distribute modified versions of this document, or of portions of it, under the above conditions, provided also that they carry prominent notices stating who last changed them. freqtweak-0.7.2/freqtweak.10000644000175200017520000001042611226173741014557 0ustar develdevel.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH FREQTWEAK 1 "February 11, 2003" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME freqtweak \- Realtime audio frequency spectral manipulation .SH SYNOPSIS .br .B freqtweak .RI [-h] [ .B -c .I ] [ .B -i .I ] [ .B -o .I ] [ .B -n .I ] [ .B -D .I ] [ .B -p .I ] [ .B -r .I ] .br .SH DESCRIPTION .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBfreqtweak\fP is a graphical tool for realtime audio spectral manipulation and display. It provides several algorithms for processing audio data in the frequency domain and a highly interactive GUI to manipulate each associated filter. It also provides high-resolution spectral displays in the form of scrolling-raster spectrograms and energy vs frequency plots displaying both pre and post-processed spectra. .SH MOUSE CONTROL .P The processing filters are controlled through mouse operations on each filter GUI window. The possible operations are: .P .I Left button click/drag to draw filters. If Control is down, the y-axis is fixed at the last cursor location (to draw nice horizontal lines). If Control and Alt are down you can draw nice arbitrary straight lines. .I Right button drag to move filters around in space. The filters wrap around the left/right edges unless you hold down Control. Dragging with both left and right buttons down on the GUI for the Gate processor moves both the primary and the alternate filter together. .I Holding Shift modifies the alternate filter (on double filter graphs like Gate) for the previous operations. .I Middle-button pops up frequency axis menu. .I Ctrl-Alt right-click resets a filter to default values. .I Shift-Ctrl-Alt left-drag zooms in on the y axis. Look at the status bar to see the values for the cursor itself and the values of the filter at the cursor's frequency. .I Shift-Ctrl-Alt right-click release resets the Y-zoom to full. The .I B and BA buttons mean Bypass and Bypass All respectively. The .I L and LA buttons mean Link and Link All respectively. The .I G and GS buttons mean Toggle Grid and Toggle Grid Snap respectively. .SH OPTIONS This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. .TP .B \-h, \-\-help Show summary of options. .TP .B \-c , \-\-channels= Processing channels (1-4). Default is 2. .TP .B \-i , \-\-inputs= Connect inputs from these jack ports (separate each channel with commas). Defaults to 'alsa_pcm:capture_1,...' .TP .B \-o , \-\-outputs= Connect outputs to these jack ports (separate each channel with commas). Defaults to 'alsa_pcm:playback_1,...' .TP .B \-n , \-\-jack-name= Jack name. Default is freqtweak_1. .TP .B \-D , \-\-tmpdir= Jack server tmp directory (should match jackd --tmpdir). .TP .B \-p , \-\-preset= Load the given preset initially. .TP .B \-r , \-\-rc-dir= Specifies what directory to use for run-control state. Default is ~/.freqtweak. .SH EXAMPLES Here is an example of using freqtweak with an alsaplayer feeding it and output going to speakers (alsa_pcm:out_?) without using a JACK patchbay: Start freqtweak first with this command line: .T .B freqtweak -n ft & Then start alsaplayer like so: .B alsaplayer -o jack -d ft:in_1,ft:in_2 & .SH SEE ALSO .BR jackd (1), .BR jack_connect (1), .BR jack_lsp (1) .SH AUTHOR Freqtweak was written and is maintained by Jesse Chappell . .P This manual page was created by Enrique Robledo Arnuncio for the Debian GNU/Linux system, using text from the README file by Jesse Chappell. freqtweak-0.7.2/depcomp0000755000175200017520000002753310711547364014074 0ustar develdevel#! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. This file always lives in the current directory. # Also, the AIX compiler puts `$object:' at the start of each line; # $object doesn't have directory information. stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" outname="$stripped.o" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a space and a tab in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. We will use -o /dev/null later, # however we can't do the remplacement now because # `-o $object' might simply not be used IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M "$@" -o /dev/null $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; -*) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 freqtweak-0.7.2/aclocal.m40000644000175200017520000011341511226200754014341 0ustar develdevel# generated automatically by aclocal 1.7.9 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Do all the work for Automake. -*- Autoconf -*- # This macro actually does too much some checks are only needed if # your package does certain things. But this isn't really a big deal. # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 10 AC_PREREQ([2.54]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.7.9])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # -*- Autoconf -*- # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 3 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_AUX_DIR_EXPAND # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. # Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50]) AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # AM_PROG_INSTALL_STRIP # Copyright 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # -*- Autoconf -*- # Copyright (C) 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 1 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # serial 5 -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 5 AC_PREREQ(2.52) # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]) fi])]) # Add --enable-maintainer-mode option to configure. # From Jim Meyering # Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # serial 2 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program 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 # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$PKG_CONFIG"; then if test -n "$$1"; then pkg_cv_[]$1="$$1" else PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` else $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. AC_PREREQ([2.52]) # serial 6 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) freqtweak-0.7.2/README0000644000175200017520000002014511226173741013363 0ustar develdevelFreqTweak - Realtime audio frequency spectral manipulation Written by Jesse Chappell Please see the file COPYING for license details. For building and installation instructions please see the INSTALL file. **** Description **** FreqTweak is a tool for realtime audio spectral manipulation and display. It provides several algorithms for processing audio data in the frequency domain and a highly interactive GUI to manipulate the associated filters for each. It also provides high-resolution spectral displays in the form of scrolling- raster spectragrams and energy vs frequency plots displaying both pre- and post-processed spectra. It is an extremely addictive audio toy, but I hope it has value for serious audio work too (sound design, etc). The spectrum analysis is pretty useful in its own right. **** Features **** Freqtweak supports manipulating the spectral filters at several frequency resolutions (64,128,256,512,1024,2048, or 4096 bands) depending on your needs/ resources. Overlap and windowing are also selectable. The GUI filter graph manipulators (and analysis plots) have selectable frequency scale types: 1x and 2x linear, and two log scales to help with modulating the musical frequencies. Filters can be linked across multiple channels. The current processing filters are described below in the order audio is processed in the chain. Any or all of the filters can be bypassed. The state of all filters can be stored or loaded as presets. ** Spectral Analysis -- Multicolor scrolling-raster spectragram, or energy vs. freq line or bar plots... one shows pre-processed, another shows post-processed. ** EQ Cut/Boost -- Your basic multi-band frequency attenuation. But you get an unhealthy number of bands... Note that this EQ is not intended for mastering purposes, it allows for (and doesn't protect against) highly irregular filtering. Two versions, one does only frequency gain cut, the other boost. ** Pitch Scaling -- This is an interesting application of Sprengler's pitch scaling algorithm (used in Steve Harris' LADSPA plugin). If you keep all the bins at the same scale, it is equivalent to Steve's plugin, but when you start applying different scales per frequency bin, things quickly get weird. For highest quality results (at the expense of transients) use larger FFT (>= 1024 bins). ** Gate -- This is a double filter where a given frequency band is allowed to pass through (unaltered) if the power on that band is between two dB thresholds... otherwise its gain is clamped to 0. ** Delay -- This lets you delay the audio on a per frequency-bin basis yielding some pretty wild effects (or subtle, if you are careful). A feedback filter controls the feedback of the delay per bin (be careful with this one). This is basically what Native Instrument's Spektral- Delay accomplishes. Granted, I don't have all the automated filter modulations (yet ;). See their website for audio examples of what is possible with this cool effect. ** Limit -- This is very harsh brick wall limiter on a per-bin basis. It is not very pleasant, but can be interesting. ** Compressor This is a massively multiband compressor. It will not behave quite like a normal time-domain compressor because of the inherent block processing of the FFT. Each frequency bin has its own compressor complete with Threshold, Ratio, Attack/Release time, and makeup gain. Again, this is *not* suitable for mastering applications! ** Warp -- This one is a little different, both axes represent frequency, and the identity matrix is unaltered audio. Changing the value (height) of a bin, reallocates the energy at that frequency to the new frequency bin represented by the height of the bar. For instance, if all bins are the same height, all the frequency energy is added to a single bin. This is a sensitive filter, the Log frequency scale is helpful here (it affects both axes). Modulators to an filter can be attached from the Modulations Window (Control->Modulators... Ctrl-M). Add a modulator by clicking on the Add Modulator... button and select from the choices. To attach a modulator to a filter, click on the Attach... button on the modulator panel and pick a filter. You can modulate many filters simultaneously. The text entry fields can be used to exactly set the slider values, by pressing enter/return after entering the number. The following modulators are currently implemented, with more to come soon. ** Rotate -- this will continually shift a filter horizontally at a constant definable Rate, wrapping when it reaches the edge. The edges are definable with the Min and Max Freq controls. ** Rotate LFO -- the same as the above, except the shifting rate oscillates via LFO with its own Rate and Depth controls. Currently there are sine, triangle, and square waveform shapes. The frequency range that the modulator affects is definable with the Min and Max Freq controls. ** Value LFO -- shifts the values up and down with an LFO. The depth control here is percentage of total value range. The frequency range that the modulator affects is definable with the Min and Max Freq controls. ** Randomize -- randomizes the bin values between the given value bounds (as percentages of total range). Again, the frequency range that the modulator affects is definable with the Min and Max Freq controls. **** Requirements **** * JACK [jackit.sf.net] -- providing realtime low-latency audio interconnection and delivery. JACK requires the ALSA Linux sound drivers so you'll need those too. * FFTW [www.fftw.org] -- for speedy FFT processing (compiled as single-precision) Supports v2 or v3. * wxWindows (wxGTK) [www.wxwindows.org] -- the GUI toolkit I've chosen to use. It should work with the most 2.2.x, 2.3.x, and 2.4.x. * libsigc++ 1.2 -- this library is usually already on recent systems but can be found at [ http://libsigc.sourceforge.net/ ] **** Misc Usage Tips **** * Left button click/drag to draw filters. If Control is down, the y-axis is fixed at the last cursor location (to draw nice horizontal lines). If Control *and* Alt are down you can draw nice arbitrary lines. * Right button drag to move filters around in space. The filters wrap around the left/right edges unless you hold down Control. Dragging with both left and right buttons down moves both primary and alternate together (on Gate). * Holding Shift modifies the alternate filter (on double filter graphs like Gate) for the previous operations. * Middle-button pops up frequency axis menu. * Ctrl-Alt right-click resets a filter to default values. * Shift-Ctrl-Alt Left-Drag zooms in on the y axis. Look at the status bar to see the values for the cursor itself and the values of the filter at the cursor's frequency. Shift-Ctrl-Alt Right click-release resets the Y-zoom to full. * The B and BA buttons mean Bypass and Bypass All respectively. * The L and LA buttons mean Link and Link All respectively. **** Here is an example of using freqtweak with an alsaplayer feeding it and output going to speakers (alsa_pcm:out_?) without using a JACK patchbay: Start freqtweak first with this command line: freqtweak -i none,none -n ft & [ you will see some jack errors, ignore them.. they are intentional ] Start alsaplayer like so: alsaplayer -o jack -d ft:in_1,ft:in_2 & **** TODO **** * Fix known bugs * Support reordering of processing modules * Automated filter modulation (via plugins?) * Plot performance optimizations (OpenGL?) * Whatever else the users want :) ============================================================================== Jesse Chappell Last modified: Sat Oct 12 13:02:59 EDT 2002 freqtweak-0.7.2/THANKS0000644000175200017520000000057611226173741013424 0ustar develdevelfreqtweak THANKS file FreqTweak has originally been written by Jesse Chappell. Many people have further contributed to FreqTweak by reporting problems, suggesting various improvements, or submitting actual code. Here is a list of these people. Help me keep it complete and exempt of errors. - Steve Harris - Mark Knecht - Kai Vehmanen - Takaski Iwai - Enrique Robledo Arnuncio freqtweak-0.7.2/configure0000755000175200017520000073750011226200761014415 0ustar develdevel#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="src/FTapp.cpp" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE LN_S GREP EGREP PKG_CONFIG JACK_CFLAGS JACK_LIBS SIGCPP_CFLAGS SIGCPP_LIBS ARCH_TYPE ARCH_X86_TRUE ARCH_X86_FALSE ARCH_486_TRUE ARCH_486_FALSE ARCH_586_TRUE ARCH_586_FALSE ARCH_686_TRUE ARCH_686_FALSE ARCH_PPC_TRUE ARCH_PPC_FALSE ARCH_ULTRA_TRUE ARCH_ULTRA_FALSE ARCH_CFLAGS FFTW_CFLAGS FFTW_LIBS XML_CFLAGS XML_LIBS WX_CONFIG0 WX_CONFIG1 WX_CONFIG2 WX_CONFIG3 WX_CONFIG4 WX_CONFIG FREQTWEAK_MAJOR_VERSION FREQTWEAK_MINOR_VERSION FREQTWEAK_MICRO_VERSION FREQTWEAK_VERSION LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC PKG_CONFIG JACK_CFLAGS JACK_LIBS SIGCPP_CFLAGS SIGCPP_LIBS FFTW_CFLAGS FFTW_LIBS XML_CFLAGS XML_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors --enable-debug not optimized and includes debug symbols Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-fftw=PFX Prefix where fftw is installed (optional) --with-fftw3 Try to use fftw3 if installed (yes by default) --with-wxconfig-path=PATH full path to wx-config to use Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags PKG_CONFIG path to pkg-config utility JACK_CFLAGS C compiler flags for JACK, overriding pkg-config JACK_LIBS linker flags for JACK, overriding pkg-config SIGCPP_CFLAGS C compiler flags for SIGCPP, overriding pkg-config SIGCPP_LIBS linker flags for SIGCPP, overriding pkg-config FFTW_CFLAGS C compiler flags for FFTW, overriding pkg-config FFTW_LIBS linker flags for FFTW, overriding pkg-config XML_CFLAGS C compiler flags for XML, overriding pkg-config XML_LIBS linker flags for XML, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu BETA= FREQTWEAK_MAJOR_VERSION=0 FREQTWEAK_MINOR_VERSION=7 FREQTWEAK_MICRO_VERSION=2 FREQTWEAK_VERSION=$FREQTWEAK_MAJOR_VERSION.$FREQTWEAK_MINOR_VERSION.${FREQTWEAK_MICRO_VERSION}${BETA} am__api_version="1.7" ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm -f conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=freqtweak VERSION=${FREQTWEAK_VERSION} cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. { echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6; } GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c : > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # (even with -Werror). So we grep stderr for any message # that says an option was ignored. if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6; } fi { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi if test -z $PKG_CONFIG_PATH; then PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig fi export PKG_CONFIG_PATH if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { echo "$as_me:$LINENO: checking for JACK" >&5 echo $ECHO_N "checking for JACK... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$JACK_CFLAGS"; then pkg_cv_JACK_CFLAGS="$JACK_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"jack >= 0.80.0\"") >&5 ($PKG_CONFIG --exists --print-errors "jack >= 0.80.0") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_JACK_CFLAGS=`$PKG_CONFIG --cflags "jack >= 0.80.0" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$JACK_LIBS"; then pkg_cv_JACK_LIBS="$JACK_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"jack >= 0.80.0\"") >&5 ($PKG_CONFIG --exists --print-errors "jack >= 0.80.0") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_JACK_LIBS=`$PKG_CONFIG --libs "jack >= 0.80.0" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then JACK_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "jack >= 0.80.0"` else JACK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "jack >= 0.80.0"` fi # Put the nasty error message in config.log where it belongs echo "$JACK_PKG_ERRORS" >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } have_jack=no elif test $pkg_failed = untried; then have_jack=no else JACK_CFLAGS=$pkg_cv_JACK_CFLAGS JACK_LIBS=$pkg_cv_JACK_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } have_jack=yes fi if test "x$have_jack" != "xno" then { echo "$as_me:$LINENO: checking for jack_client_open in -ljack" >&5 echo $ECHO_N "checking for jack_client_open in -ljack... $ECHO_C" >&6; } if test "${ac_cv_lib_jack_jack_client_open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljack $JACK_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jack_client_open (); int main () { return jack_client_open (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_jack_jack_client_open=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_jack_jack_client_open=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_jack_jack_client_open" >&5 echo "${ECHO_T}$ac_cv_lib_jack_jack_client_open" >&6; } if test $ac_cv_lib_jack_jack_client_open = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_JACK_CLIENT_OPEN 1 _ACEOF fi fi pkg_failed=no { echo "$as_me:$LINENO: checking for SIGCPP" >&5 echo $ECHO_N "checking for SIGCPP... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$SIGCPP_CFLAGS"; then pkg_cv_SIGCPP_CFLAGS="$SIGCPP_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sigc++-1.2 >= 0.14\"") >&5 ($PKG_CONFIG --exists --print-errors "sigc++-1.2 >= 0.14") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_SIGCPP_CFLAGS=`$PKG_CONFIG --cflags "sigc++-1.2 >= 0.14" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$SIGCPP_LIBS"; then pkg_cv_SIGCPP_LIBS="$SIGCPP_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"sigc++-1.2 >= 0.14\"") >&5 ($PKG_CONFIG --exists --print-errors "sigc++-1.2 >= 0.14") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_SIGCPP_LIBS=`$PKG_CONFIG --libs "sigc++-1.2 >= 0.14" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then SIGCPP_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "sigc++-1.2 >= 0.14"` else SIGCPP_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "sigc++-1.2 >= 0.14"` fi # Put the nasty error message in config.log where it belongs echo "$SIGCPP_PKG_ERRORS" >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } have_sigc12=no elif test $pkg_failed = untried; then have_sigc12=no else SIGCPP_CFLAGS=$pkg_cv_SIGCPP_CFLAGS SIGCPP_LIBS=$pkg_cv_SIGCPP_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } have_sigc12=yes fi { echo "$as_me:$LINENO: checking for pow in -lm" >&5 echo $ECHO_N "checking for pow in -lm... $ECHO_C" >&6; } if test "${ac_cv_lib_m_pow+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pow (); int main () { return pow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_m_pow=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_m_pow=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_m_pow" >&5 echo "${ECHO_T}$ac_cv_lib_m_pow" >&6; } if test $ac_cv_lib_m_pow = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi for ac_func in memmove do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in memset do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in mkdir do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in pow do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in sqrt do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fcntl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in values.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking machine architecture" >&5 echo $ECHO_N "checking machine architecture... $ECHO_C" >&6; } ARCH_TYPE=`uname -m` { echo "$as_me:$LINENO: result: $ARCH_TYPE" >&5 echo "${ECHO_T}$ARCH_TYPE" >&6; } if test "$ARCH_TYPE" = "i486" || test "$ARCH_TYPE" = "i586" || test "$ARCH_TYPE" = "i686" ; then ARCH_X86_TRUE= ARCH_X86_FALSE='#' else ARCH_X86_TRUE='#' ARCH_X86_FALSE= fi if test "$ARCH_TYPE" = "i486"; then ARCH_486_TRUE= ARCH_486_FALSE='#' else ARCH_486_TRUE='#' ARCH_486_FALSE= fi if test "$ARCH_TYPE" = "i586"; then ARCH_586_TRUE= ARCH_586_FALSE='#' else ARCH_586_TRUE='#' ARCH_586_FALSE= fi if test "$ARCH_TYPE" = "i686"; then ARCH_686_TRUE= ARCH_686_FALSE='#' else ARCH_686_TRUE='#' ARCH_686_FALSE= fi if test "$ARCH_TYPE" = "ppc"; then ARCH_PPC_TRUE= ARCH_PPC_FALSE='#' else ARCH_PPC_TRUE='#' ARCH_PPC_FALSE= fi if test "$ARCH_TYPE" = "sun4u"; then ARCH_ULTRA_TRUE= ARCH_ULTRA_FALSE='#' else ARCH_ULTRA_TRUE='#' ARCH_ULTRA_FALSE= fi { echo "$as_me:$LINENO: checking for gcc optimization flags" >&5 echo $ECHO_N "checking for gcc optimization flags... $ECHO_C" >&6; } old_cflags=$CFLAGS CFLAGS="$CFLAGS -O2 -fexpensive-optimizations -funroll-loops -finline-functions -ffast-math" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { printf ("hello, world"); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then EXTRA_OPT_CFLAGS="-O2 -fexpensive-optimizations -funroll-loops -finline-functions -ffast-math" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 EXTRA_OPT_CFLAGS="" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS=$old_cflags { echo "$as_me:$LINENO: result: $EXTRA_OPT_CFLAGS" >&5 echo "${ECHO_T}$EXTRA_OPT_CFLAGS" >&6; } ARCH_CFLAGS="$CFLAGS $EXTRA_OPT_CFLAGS" if test "$ARCH_TYPE" = "i486" || test "$ARCH_TYPE" = "i586" || test "$ARCH_TYPE" = "i686" then cat >>confdefs.h <<\_ACEOF #define ARCH_X86 1 _ACEOF fi if test "$ARCH_TYPE" = "i486" then cat >>confdefs.h <<\_ACEOF #define ARCH_486 1 _ACEOF fi if test "$ARCH_TYPE" = "i586" then cat >>confdefs.h <<\_ACEOF #define ARCH_586 1 _ACEOF fi if test "$ARCH_TYPE" = "i686" then cat >>confdefs.h <<\_ACEOF #define ARCH_686 1 _ACEOF # EXTRA_CPU_CFLAGS=$(if $CC -march=i686 -S -o /dev/null -xc /dev/null > /dev/null; then echo "-march=i686"; fi) fi if test "$ARCH_TYPE" = "ppc" then cat >>confdefs.h <<\_ACEOF #define ARCH_PPC 1 _ACEOF fi if test "$ARCH_TYPE" = "sun4u" then cat >>confdefs.h <<\_ACEOF #define ARCH_ULTRA 1 _ACEOF fi ac_config_headers="$ac_config_headers config.h" case "$host" in i?86-* | k?-* | athlon-*) cat >>confdefs.h <<\_ACEOF #define FPM_INTEL 1 _ACEOF ;; *-*) echo "host_alias = $host_alias" cat >>confdefs.h <<\_ACEOF #define FPM_64BIT 1 _ACEOF ;; esac ARCH_CFLAGS="$ARCH_CFLAGS $EXTRA_CPU_CFLAGS" { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # FFTW section use_fftw=yes # Check whether --with-fftw was given. if test "${with_fftw+set}" = set; then withval=$with_fftw; fftw_prefix="$withval" else fftw_prefix="/usr/local" fi # Check whether --with-fftw3 was given. if test "${with_fftw3+set}" = set; then withval=$with_fftw3; try_fftw3="$withval" else try_fftw3="yes" fi if test "x$try_fftw3" != "xno" then # try fftw3 first #PKG_CHECK_MODULES(FFTW, fftw3f >= 3.0, [AC_DEFINE(USING_FFTW3, [1], [Using FFTW3])] , [AC_DEFINE(USING_FFTW3, [0], [Using FFTW3])] ) pkg_failed=no { echo "$as_me:$LINENO: checking for FFTW" >&5 echo $ECHO_N "checking for FFTW... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$FFTW_CFLAGS"; then pkg_cv_FFTW_CFLAGS="$FFTW_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"fftw3f >= 3.0\"") >&5 ($PKG_CONFIG --exists --print-errors "fftw3f >= 3.0") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_FFTW_CFLAGS=`$PKG_CONFIG --cflags "fftw3f >= 3.0" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$FFTW_LIBS"; then pkg_cv_FFTW_LIBS="$FFTW_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"fftw3f >= 3.0\"") >&5 ($PKG_CONFIG --exists --print-errors "fftw3f >= 3.0") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_FFTW_LIBS=`$PKG_CONFIG --libs "fftw3f >= 3.0" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FFTW_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "fftw3f >= 3.0"` else FFTW_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "fftw3f >= 3.0"` fi # Put the nasty error message in config.log where it belongs echo "$FFTW_PKG_ERRORS" >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } have_fftw3=no elif test $pkg_failed = untried; then have_fftw3=no else FFTW_CFLAGS=$pkg_cv_FFTW_CFLAGS FFTW_LIBS=$pkg_cv_FFTW_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } have_fftw3=yes fi fi if test "x$have_fftw3" = "xyes" then cat >>confdefs.h <<\_ACEOF #define USING_FFTW3 1 _ACEOF else # no fftw3 if test "x$use_fftw" = "xyes" then LDFLAGS="$LDFLAGS -L$fftw_prefix/lib -lm" JACK_CFLAGS="-I$fftw_prefix/include" CFLAGS="$CFLAGS $FFTW_CFLAGS" CPPFLAGS="$CPPFLAGS $FFTW_CFLAGS" # check for single precision convention first { echo "$as_me:$LINENO: checking for fftw_create_plan in -lsfftw" >&5 echo $ECHO_N "checking for fftw_create_plan in -lsfftw... $ECHO_C" >&6; } if test "${ac_cv_lib_sfftw_fftw_create_plan+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fftw_create_plan (); int main () { return fftw_create_plan (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_sfftw_fftw_create_plan=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_sfftw_fftw_create_plan=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_sfftw_fftw_create_plan" >&5 echo "${ECHO_T}$ac_cv_lib_sfftw_fftw_create_plan" >&6; } if test $ac_cv_lib_sfftw_fftw_create_plan = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSFFTW 1 _ACEOF LIBS="-lsfftw $LIBS" fi { echo "$as_me:$LINENO: checking for rfftw_create_plan in -lsrfftw" >&5 echo $ECHO_N "checking for rfftw_create_plan in -lsrfftw... $ECHO_C" >&6; } if test "${ac_cv_lib_srfftw_rfftw_create_plan+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsrfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rfftw_create_plan (); int main () { return rfftw_create_plan (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_srfftw_rfftw_create_plan=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_srfftw_rfftw_create_plan=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_srfftw_rfftw_create_plan" >&5 echo "${ECHO_T}$ac_cv_lib_srfftw_rfftw_create_plan" >&6; } if test $ac_cv_lib_srfftw_rfftw_create_plan = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSRFFTW 1 _ACEOF LIBS="-lsrfftw $LIBS" fi { echo "$as_me:$LINENO: checking for rfftw_create_plan in -lsrfftw" >&5 echo $ECHO_N "checking for rfftw_create_plan in -lsrfftw... $ECHO_C" >&6; } if test "${ac_cv_lib_srfftw_rfftw_create_plan+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsrfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rfftw_create_plan (); int main () { return rfftw_create_plan (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_srfftw_rfftw_create_plan=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_srfftw_rfftw_create_plan=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_srfftw_rfftw_create_plan" >&5 echo "${ECHO_T}$ac_cv_lib_srfftw_rfftw_create_plan" >&6; } if test $ac_cv_lib_srfftw_rfftw_create_plan = yes; then have_fftw=yes else have_fftw=no fi if [ "$have_fftw" = "no" ] ; then # AC_MSG_ERROR("Could not find FFTW! Is it installed (www.fftw.org) ? ") { echo "$as_me:$LINENO: checking for fftw_create_plan in -lfftw" >&5 echo $ECHO_N "checking for fftw_create_plan in -lfftw... $ECHO_C" >&6; } if test "${ac_cv_lib_fftw_fftw_create_plan+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fftw_create_plan (); int main () { return fftw_create_plan (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_fftw_fftw_create_plan=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fftw_fftw_create_plan=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_fftw_fftw_create_plan" >&5 echo "${ECHO_T}$ac_cv_lib_fftw_fftw_create_plan" >&6; } if test $ac_cv_lib_fftw_fftw_create_plan = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBFFTW 1 _ACEOF LIBS="-lfftw $LIBS" fi { echo "$as_me:$LINENO: checking for rfftw_create_plan in -lrfftw" >&5 echo $ECHO_N "checking for rfftw_create_plan in -lrfftw... $ECHO_C" >&6; } if test "${ac_cv_lib_rfftw_rfftw_create_plan+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rfftw_create_plan (); int main () { return rfftw_create_plan (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_rfftw_rfftw_create_plan=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rfftw_rfftw_create_plan=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_rfftw_rfftw_create_plan" >&5 echo "${ECHO_T}$ac_cv_lib_rfftw_rfftw_create_plan" >&6; } if test $ac_cv_lib_rfftw_rfftw_create_plan = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRFFTW 1 _ACEOF LIBS="-lrfftw $LIBS" fi { echo "$as_me:$LINENO: checking for rfftw_create_plan in -lrfftw" >&5 echo $ECHO_N "checking for rfftw_create_plan in -lrfftw... $ECHO_C" >&6; } if test "${ac_cv_lib_rfftw_rfftw_create_plan+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrfftw $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char rfftw_create_plan (); int main () { return rfftw_create_plan (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_rfftw_rfftw_create_plan=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_rfftw_rfftw_create_plan=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_rfftw_rfftw_create_plan" >&5 echo "${ECHO_T}$ac_cv_lib_rfftw_rfftw_create_plan" >&6; } if test $ac_cv_lib_rfftw_rfftw_create_plan = yes; then have_fftw=yes else have_fftw=no fi if [ "$have_fftw" = "no" ] ; then { { echo "$as_me:$LINENO: error: 'Could not find FFTW! Is it installed? www.fftw.org '" >&5 echo "$as_me: error: 'Could not find FFTW! Is it installed? www.fftw.org '" >&2;} { (exit 1); exit 1; }; } fi cat > mytest.$ac_ext < EOF else cat > mytest.$ac_ext < EOF fi for ac_header in sfftw.h srfftw.h fftw.h rfftw.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { echo "$as_me:$LINENO: checking if FFTW is actually float precision" >&5 echo $ECHO_N "checking if FFTW is actually float precision... $ECHO_C" >&6; } cat >> mytest.$ac_ext <&5 if ./mytest ; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } { { echo "$as_me:$LINENO: error: ========================================================================== ERROR: FreqTweak needs an FFTW library compiled with float precision Try rebuilding and installing FFTW with the following configure options: --enable-float --enable-type-prefix ========================================================================== " >&5 echo "$as_me: error: ========================================================================== ERROR: FreqTweak needs an FFTW library compiled with float precision Try rebuilding and installing FFTW with the following configure options: --enable-float --enable-type-prefix ========================================================================== " >&2;} { (exit 1); exit 1; }; } fi rm -f ./mytest ./mytest.$ac_ext fi fi # end fftw section pkg_failed=no { echo "$as_me:$LINENO: checking for XML" >&5 echo $ECHO_N "checking for XML... $ECHO_C" >&6; } if test -n "$PKG_CONFIG"; then if test -n "$XML_CFLAGS"; then pkg_cv_XML_CFLAGS="$XML_CFLAGS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.0") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_XML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.0" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test -n "$PKG_CONFIG"; then if test -n "$XML_LIBS"; then pkg_cv_XML_LIBS="$XML_LIBS" else if test -n "$PKG_CONFIG" && \ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libxml-2.0 >= 2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "libxml-2.0 >= 2.0") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_XML_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.0" 2>/dev/null` else pkg_failed=yes fi fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then XML_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "libxml-2.0 >= 2.0"` else XML_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "libxml-2.0 >= 2.0"` fi # Put the nasty error message in config.log where it belongs echo "$XML_PKG_ERRORS" >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } have_xml2=no elif test $pkg_failed = untried; then have_xml2=no else XML_CFLAGS=$pkg_cv_XML_CFLAGS XML_LIBS=$pkg_cv_XML_LIBS { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } have_xml2=yes fi if [ "$have_jack" = "no" ] ; then { { echo "$as_me:$LINENO: error: 'Could not find jack! Is it installed (jackit.sf.net) ?'" >&5 echo "$as_me: error: 'Could not find jack! Is it installed (jackit.sf.net) ?'" >&2;} { (exit 1); exit 1; }; } fi #AC_MSG_CHECKING(for wxWindows) # Check whether --with-wxconfig-path was given. if test "${with_wxconfig_path+set}" = set; then withval=$with_wxconfig_path; fi if test "x$with_wxconfig_path" != "x" ; then WX_CONFIG=$with_wxconfig_path else WX_CONFIG="" fi if [ "$WX_CONFIG" = "" ] ; then # Extract the first word of "wx-config-2.6", so it can be a program name with args. set dummy wx-config-2.6; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_WX_CONFIG0+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $WX_CONFIG0 in [\\/]* | ?:[\\/]*) ac_cv_path_WX_CONFIG0="$WX_CONFIG0" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/local/bin " for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_WX_CONFIG0="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_WX_CONFIG0" && ac_cv_path_WX_CONFIG0="no" ;; esac fi WX_CONFIG0=$ac_cv_path_WX_CONFIG0 if test -n "$WX_CONFIG0"; then { echo "$as_me:$LINENO: result: $WX_CONFIG0" >&5 echo "${ECHO_T}$WX_CONFIG0" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if [ "$WX_CONFIG0" = "no" ] ; then # Extract the first word of "wxgtk2-2.5-config", so it can be a program name with args. set dummy wxgtk2-2.5-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_WX_CONFIG1+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $WX_CONFIG1 in [\\/]* | ?:[\\/]*) ac_cv_path_WX_CONFIG1="$WX_CONFIG1" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/local/bin " for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_WX_CONFIG1="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_WX_CONFIG1" && ac_cv_path_WX_CONFIG1="no" ;; esac fi WX_CONFIG1=$ac_cv_path_WX_CONFIG1 if test -n "$WX_CONFIG1"; then { echo "$as_me:$LINENO: result: $WX_CONFIG1" >&5 echo "${ECHO_T}$WX_CONFIG1" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if [ "$WX_CONFIG1" = "no" ] ; then # Extract the first word of "wxgtk2-2.4-config", so it can be a program name with args. set dummy wxgtk2-2.4-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_WX_CONFIG2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $WX_CONFIG2 in [\\/]* | ?:[\\/]*) ac_cv_path_WX_CONFIG2="$WX_CONFIG2" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/local/bin " for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_WX_CONFIG2="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_WX_CONFIG2" && ac_cv_path_WX_CONFIG2="no" ;; esac fi WX_CONFIG2=$ac_cv_path_WX_CONFIG2 if test -n "$WX_CONFIG2"; then { echo "$as_me:$LINENO: result: $WX_CONFIG2" >&5 echo "${ECHO_T}$WX_CONFIG2" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if [ "$WX_CONFIG2" = "no" ] ; then # Extract the first word of "wxgtk-2.4-config", so it can be a program name with args. set dummy wxgtk-2.4-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_WX_CONFIG3+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $WX_CONFIG3 in [\\/]* | ?:[\\/]*) ac_cv_path_WX_CONFIG3="$WX_CONFIG3" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/local/bin " for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_WX_CONFIG3="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_WX_CONFIG3" && ac_cv_path_WX_CONFIG3="no" ;; esac fi WX_CONFIG3=$ac_cv_path_WX_CONFIG3 if test -n "$WX_CONFIG3"; then { echo "$as_me:$LINENO: result: $WX_CONFIG3" >&5 echo "${ECHO_T}$WX_CONFIG3" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if [ "$WX_CONFIG3" = "no" ] ; then # Extract the first word of "wx-config", so it can be a program name with args. set dummy wx-config; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_WX_CONFIG4+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $WX_CONFIG4 in [\\/]* | ?:[\\/]*) ac_cv_path_WX_CONFIG4="$WX_CONFIG4" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_dummy="$PATH:/usr/local/bin " for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_WX_CONFIG4="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_WX_CONFIG4" && ac_cv_path_WX_CONFIG4="no" ;; esac fi WX_CONFIG4=$ac_cv_path_WX_CONFIG4 if test -n "$WX_CONFIG4"; then { echo "$as_me:$LINENO: result: $WX_CONFIG4" >&5 echo "${ECHO_T}$WX_CONFIG4" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if [ "$WX_CONFIG4" = "no" ] ; then { { echo "$as_me:$LINENO: error: \"Could not find any wx-config scripts: is wxWindows installed?\"" >&5 echo "$as_me: error: \"Could not find any wx-config scripts: is wxWindows installed?\"" >&2;} { (exit 1); exit 1; }; } else WX_CONFIG=$WX_CONFIG4 fi else WX_CONFIG=$WX_CONFIG3 fi else WX_CONFIG=$WX_CONFIG2 fi else WX_CONFIG=$WX_CONFIG1 fi else WX_CONFIG=$WX_CONFIG0 fi fi WX_LIBS="`$WX_CONFIG --libs`" if $WX_CONFIG --cxxflags > /dev/null 2>&1 ; then WX_CFLAGS="`$WX_CONFIG --cxxflags`" else WX_CFLAGS="`$WX_CONFIG --cflags`" fi #UNAME_MACHINE=`uname -m` #CXXFLAGS="$JACK_CFLAGS -g -Wall -O3 -fomit-frame-pointer -fstrength-reduce -funroll-loops -fmove-all-movables -ffast-math -mcpu=${UNAME_MACHINE} -march=${UNAME_MACHINE}" # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; if test "x$enable_debug" != "xno" ; then CXXFLAGS="-g -Wall -D_REENTRANT $FFTW_CFLAGS $JACK_CFLAGS $WX_CFLAGS $XML_CFLAGS $SIGCPP_CFLAGS" CFLAGS="$CXXFLAGS" else CXXFLAGS="$FFTW_CFLAGS $JACK_CFLAGS $WX_CFLAGS $XML_CFLAGS $SIGCPP_CFLAGS -Wall -D_REENTRANT $ARCH_CFLAGS" CFLAGS="$CXXFLAGS" fi else CXXFLAGS="$FFTW_CFLAGS $JACK_CFLAGS $WX_CFLAGS $XML_CFLAGS $SIGCPP_CFLAGS -Wall -D_REENTRANT $ARCH_CFLAGS" CFLAGS="$CXXFLAGS" fi #CFLAGS="$CPPFLAGS $FFTW_CFLAGS $JACK_CFLAGS $WX_CFLAGS $XML_CFLAGS -Wall -D_REENTRANT $ARCH_CFLAGS" #CXXFLAGS="$CFLAGS" #CXXFLAGS="-g -Wall $FFTW_CFLAGS $JACK_CFLAGS $WX_CFLAGS $XML_CFLAGS" LIBS="$LIBS $FFTW_LIBS $JACK_LIBS $WX_LIBS $XML_LIBS $SIGCPP_LIBS" cat >>confdefs.h <<_ACEOF #define HELP_HTML_PATH "${prefix}/share/${PACKAGE}/help" _ACEOF ac_config_files="$ac_config_files Makefile src/Makefile src/version.h doc/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ARCH_X86_TRUE}" && test -z "${ARCH_X86_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ARCH_X86\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ARCH_X86\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ARCH_486_TRUE}" && test -z "${ARCH_486_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ARCH_486\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ARCH_486\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ARCH_586_TRUE}" && test -z "${ARCH_586_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ARCH_586\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ARCH_586\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ARCH_686_TRUE}" && test -z "${ARCH_686_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ARCH_686\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ARCH_686\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ARCH_PPC_TRUE}" && test -z "${ARCH_PPC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ARCH_PPC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ARCH_PPC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ARCH_ULTRA_TRUE}" && test -z "${ARCH_ULTRA_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ARCH_ULTRA\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ARCH_ULTRA\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/version.h") CONFIG_FILES="$CONFIG_FILES src/version.h" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim AMTAR!$AMTAR$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim MAINT!$MAINT$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CPP!$CPP$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim LN_S!$LN_S$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim PKG_CONFIG!$PKG_CONFIG$ac_delim JACK_CFLAGS!$JACK_CFLAGS$ac_delim JACK_LIBS!$JACK_LIBS$ac_delim SIGCPP_CFLAGS!$SIGCPP_CFLAGS$ac_delim SIGCPP_LIBS!$SIGCPP_LIBS$ac_delim ARCH_TYPE!$ARCH_TYPE$ac_delim ARCH_X86_TRUE!$ARCH_X86_TRUE$ac_delim ARCH_X86_FALSE!$ARCH_X86_FALSE$ac_delim ARCH_486_TRUE!$ARCH_486_TRUE$ac_delim ARCH_486_FALSE!$ARCH_486_FALSE$ac_delim ARCH_586_TRUE!$ARCH_586_TRUE$ac_delim ARCH_586_FALSE!$ARCH_586_FALSE$ac_delim ARCH_686_TRUE!$ARCH_686_TRUE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF ARCH_686_FALSE!$ARCH_686_FALSE$ac_delim ARCH_PPC_TRUE!$ARCH_PPC_TRUE$ac_delim ARCH_PPC_FALSE!$ARCH_PPC_FALSE$ac_delim ARCH_ULTRA_TRUE!$ARCH_ULTRA_TRUE$ac_delim ARCH_ULTRA_FALSE!$ARCH_ULTRA_FALSE$ac_delim ARCH_CFLAGS!$ARCH_CFLAGS$ac_delim FFTW_CFLAGS!$FFTW_CFLAGS$ac_delim FFTW_LIBS!$FFTW_LIBS$ac_delim XML_CFLAGS!$XML_CFLAGS$ac_delim XML_LIBS!$XML_LIBS$ac_delim WX_CONFIG0!$WX_CONFIG0$ac_delim WX_CONFIG1!$WX_CONFIG1$ac_delim WX_CONFIG2!$WX_CONFIG2$ac_delim WX_CONFIG3!$WX_CONFIG3$ac_delim WX_CONFIG4!$WX_CONFIG4$ac_delim WX_CONFIG!$WX_CONFIG$ac_delim FREQTWEAK_MAJOR_VERSION!$FREQTWEAK_MAJOR_VERSION$ac_delim FREQTWEAK_MINOR_VERSION!$FREQTWEAK_MINOR_VERSION$ac_delim FREQTWEAK_MICRO_VERSION!$FREQTWEAK_MICRO_VERSION$ac_delim FREQTWEAK_VERSION!$FREQTWEAK_VERSION$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 22; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" # Compute $ac_file's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $ac_file | $ac_file:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X$ac_file : 'X\(//\)[^/]' \| \ X$ac_file : 'X\(//\)$' \| \ X$ac_file : 'X\(/\)' \| . 2>/dev/null || echo X$ac_file | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # We invoke sed twice because it is the simplest approach to # changing $(DEPDIR) to its actual value in the expansion. for file in `sed -n -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi echo echo Now type \'make\' to build FreqTweak. echo freqtweak-0.7.2/configure.ac0000644000175200017520000002247611226200601014764 0ustar develdevel# Copyright (C) 2002 Jesse Chappell # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. AC_INIT(src/FTapp.cpp) BETA= FREQTWEAK_MAJOR_VERSION=0 FREQTWEAK_MINOR_VERSION=7 FREQTWEAK_MICRO_VERSION=2 FREQTWEAK_VERSION=$FREQTWEAK_MAJOR_VERSION.$FREQTWEAK_MINOR_VERSION.${FREQTWEAK_MICRO_VERSION}${BETA} dnl AC_SUBST(FREQTWEAK_VERSION) AM_INIT_AUTOMAKE(freqtweak, ${FREQTWEAK_VERSION}) AM_MAINTAINER_MODE AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LN_S AC_HEADER_STDC dnl ====================== dnl PKGCONFIG preparations dnl ====================== if test -z $PKG_CONFIG_PATH; then PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig fi export PKG_CONFIG_PATH dnl ========== dnl JACK stuff dnl ========== PKG_CHECK_MODULES(JACK, jack >= 0.80.0, have_jack=yes, have_jack=no) if test "x$have_jack" != "xno" then AC_CHECK_LIB(jack, jack_client_open, [ AC_DEFINE([HAVE_JACK_CLIENT_OPEN], 1, [Have newer JACK connect call])], [], [$JACK_LIBS]) fi AC_SUBST(JACK_LIBS) AC_SUBST(JACK_CFLAGS) dnl sigc++ PKG_CHECK_MODULES(SIGCPP, sigc++-1.2 >= 0.14, have_sigc12=yes, have_sigc12=no) AC_CHECK_LIB(m,pow) AC_CHECK_FUNCS([memmove]) AC_CHECK_FUNCS([memset]) AC_CHECK_FUNCS([mkdir]) AC_CHECK_FUNCS([pow]) AC_CHECK_FUNCS([sqrt]) AC_CHECK_HEADERS([fcntl.h]) AC_CHECK_HEADERS([values.h]) dnl ============ dnl Machine type dnl ============ AC_MSG_CHECKING(machine architecture) AC_SUBST(ARCH_TYPE) ARCH_TYPE=`uname -m` AC_MSG_RESULT($ARCH_TYPE) AM_CONDITIONAL(ARCH_X86,test "$ARCH_TYPE" = "i486" || test "$ARCH_TYPE" = "i586" || test "$ARCH_TYPE" = "i686" ) AM_CONDITIONAL(ARCH_486,test "$ARCH_TYPE" = "i486") AM_CONDITIONAL(ARCH_586,test "$ARCH_TYPE" = "i586") AM_CONDITIONAL(ARCH_686,test "$ARCH_TYPE" = "i686") AM_CONDITIONAL(ARCH_PPC,test "$ARCH_TYPE" = "ppc") AM_CONDITIONAL(ARCH_ULTRA,test "$ARCH_TYPE" = "sun4u") AC_MSG_CHECKING(for gcc optimization flags) old_cflags=$CFLAGS CFLAGS="$CFLAGS -O2 -fexpensive-optimizations -funroll-loops -finline-functions -ffast-math" AC_TRY_COMPILE([#include ], [ printf ("hello, world"); ], [ EXTRA_OPT_CFLAGS="-O2 -fexpensive-optimizations -funroll-loops -finline-functions -ffast-math"],[ EXTRA_OPT_CFLAGS=""]) CFLAGS=$old_cflags AC_MSG_RESULT([$EXTRA_OPT_CFLAGS]) ARCH_CFLAGS="$CFLAGS $EXTRA_OPT_CFLAGS" if test "$ARCH_TYPE" = "i486" || test "$ARCH_TYPE" = "i586" || test "$ARCH_TYPE" = "i686" then AC_DEFINE(ARCH_X86, 1, [Define if on x86 platform]) fi if test "$ARCH_TYPE" = "i486" then AC_DEFINE(ARCH_486, 1, [Define if on a 486 platform]) fi if test "$ARCH_TYPE" = "i586" then AC_DEFINE(ARCH_586, 1, [Define if on a 586 platform]) fi if test "$ARCH_TYPE" = "i686" then AC_DEFINE(ARCH_686, 1, [Define if on a 686 platform]) # EXTRA_CPU_CFLAGS=$(if $CC -march=i686 -S -o /dev/null -xc /dev/null > /dev/null; then echo "-march=i686"; fi) fi if test "$ARCH_TYPE" = "ppc" then AC_DEFINE(ARCH_PPC, 1, [Define if on a PPC platform]) fi if test "$ARCH_TYPE" = "sun4u" then AC_DEFINE(ARCH_ULTRA, 1, [Define if on a SUN ULTRA platform]) fi dnl ================================================================ dnl Special assembly options. Note: Need to fix the above arch code! dnl ================================================================ dnl AC_CANONICAL_HOST AM_CONFIG_HEADER(config.h) case "$host" in i?86-* | k?-* | athlon-*) dnl catch i386,i486,i586,i686,k6,k7 AC_DEFINE(FPM_INTEL, 1, [Define if we are on Intel]) ;; *-*) echo "host_alias = $host_alias" AC_DEFINE(FPM_64BIT, 1, [Use this otherwise]) ;; esac ARCH_CFLAGS="$ARCH_CFLAGS $EXTRA_CPU_CFLAGS" AC_SUBST(ARCH_CFLAGS) dnl ============================================================ dnl Check for typedefs, structures, and compiler characteristics dnl ============================================================ AC_C_CONST AC_TYPE_SIZE_T # FFTW section use_fftw=yes AC_ARG_WITH(fftw,[ --with-fftw=PFX Prefix where fftw is installed (optional)], fftw_prefix="$withval", fftw_prefix="/usr/local") AC_ARG_WITH(fftw3,[ --with-fftw3 Try to use fftw3 if installed (yes by default)], try_fftw3="$withval", try_fftw3="yes") if test "x$try_fftw3" != "xno" then # try fftw3 first #PKG_CHECK_MODULES(FFTW, fftw3f >= 3.0, [AC_DEFINE(USING_FFTW3, [1], [Using FFTW3])] , [AC_DEFINE(USING_FFTW3, [0], [Using FFTW3])] ) PKG_CHECK_MODULES(FFTW, fftw3f >= 3.0, have_fftw3=yes , have_fftw3=no ) fi if test "x$have_fftw3" = "xyes" then AC_DEFINE(USING_FFTW3, [1], [Using FFTW3]) else # no fftw3 if test "x$use_fftw" = "xyes" then LDFLAGS="$LDFLAGS -L$fftw_prefix/lib -lm" JACK_CFLAGS="-I$fftw_prefix/include" CFLAGS="$CFLAGS $FFTW_CFLAGS" CPPFLAGS="$CPPFLAGS $FFTW_CFLAGS" # check for single precision convention first AC_CHECK_LIB(sfftw, fftw_create_plan) AC_CHECK_LIB(srfftw, rfftw_create_plan) AC_CHECK_LIB(srfftw, rfftw_create_plan, [ have_fftw=yes ], [ have_fftw=no ]) if [[ "$have_fftw" = "no" ]] ; then # AC_MSG_ERROR("Could not find FFTW! Is it installed (www.fftw.org) ? ") AC_CHECK_LIB(fftw, fftw_create_plan) AC_CHECK_LIB(rfftw, rfftw_create_plan) AC_CHECK_LIB(rfftw, rfftw_create_plan, [ have_fftw=yes ], [ have_fftw=no ]) if [[ "$have_fftw" = "no" ]] ; then AC_MSG_ERROR('Could not find FFTW! Is it installed? www.fftw.org ') fi cat > mytest.$ac_ext < EOF else cat > mytest.$ac_ext < EOF fi AC_CHECK_HEADERS(sfftw.h srfftw.h fftw.h rfftw.h) AC_MSG_CHECKING([if FFTW is actually float precision]) cat >> mytest.$ac_ext <&5 if ./mytest ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) AC_MSG_ERROR([ ========================================================================== ERROR: FreqTweak needs an FFTW library compiled with float precision Try rebuilding and installing FFTW with the following configure options: --enable-float --enable-type-prefix ========================================================================== ]) fi rm -f ./mytest ./mytest.$ac_ext fi fi # end fftw section dnl LIBXML PKG_CHECK_MODULES(XML, libxml-2.0 >= 2.0, have_xml2=yes, have_xml2=no) if [[ "$have_jack" = "no" ]] ; then AC_MSG_ERROR('Could not find jack! Is it installed (jackit.sf.net) ?') fi dnl LIBS="$LIBS $JACK_LIB" #AC_MSG_CHECKING(for wxWindows) dnl wxwindows AC_ARG_WITH(wxconfig-path, [ --with-wxconfig-path=PATH full path to wx-config to use]) if test "x$with_wxconfig_path" != "x" ; then WX_CONFIG=$with_wxconfig_path else WX_CONFIG="" fi if [[ "$WX_CONFIG" = "" ]] ; then AC_PATH_PROG(WX_CONFIG0, wx-config-2.6, no, $PATH:/usr/local/bin ) if [[ "$WX_CONFIG0" = "no" ]] ; then AC_PATH_PROG(WX_CONFIG1, wxgtk2-2.5-config, no, $PATH:/usr/local/bin ) if [[ "$WX_CONFIG1" = "no" ]] ; then AC_PATH_PROG(WX_CONFIG2, wxgtk2-2.4-config, no, $PATH:/usr/local/bin ) if [[ "$WX_CONFIG2" = "no" ]] ; then AC_PATH_PROG(WX_CONFIG3, wxgtk-2.4-config, no, $PATH:/usr/local/bin ) if [[ "$WX_CONFIG3" = "no" ]] ; then AC_PATH_PROG(WX_CONFIG4, wx-config, no, $PATH:/usr/local/bin ) if [[ "$WX_CONFIG4" = "no" ]] ; then AC_MSG_ERROR("Could not find any wx-config scripts: is wxWindows installed?") else WX_CONFIG=$WX_CONFIG4 fi else WX_CONFIG=$WX_CONFIG3 fi else WX_CONFIG=$WX_CONFIG2 fi else WX_CONFIG=$WX_CONFIG1 fi else WX_CONFIG=$WX_CONFIG0 fi fi AC_SUBST(WX_CONFIG) WX_LIBS="`$WX_CONFIG --libs`" if $WX_CONFIG --cxxflags > /dev/null 2>&1 ; then WX_CFLAGS="`$WX_CONFIG --cxxflags`" else WX_CFLAGS="`$WX_CONFIG --cflags`" fi #UNAME_MACHINE=`uname -m` #CXXFLAGS="$JACK_CFLAGS -g -Wall -O3 -fomit-frame-pointer -fstrength-reduce -funroll-loops -fmove-all-movables -ffast-math -mcpu=${UNAME_MACHINE} -march=${UNAME_MACHINE}" AC_ARG_ENABLE(debug, [ --enable-debug not optimized and includes debug symbols], [ if test "x$enable_debug" != "xno" ; then CXXFLAGS="-g -Wall -D_REENTRANT $FFTW_CFLAGS $JACK_CFLAGS $WX_CFLAGS $XML_CFLAGS $SIGCPP_CFLAGS" CFLAGS="$CXXFLAGS" else CXXFLAGS="$FFTW_CFLAGS $JACK_CFLAGS $WX_CFLAGS $XML_CFLAGS $SIGCPP_CFLAGS -Wall -D_REENTRANT $ARCH_CFLAGS" CFLAGS="$CXXFLAGS" fi ], [ CXXFLAGS="$FFTW_CFLAGS $JACK_CFLAGS $WX_CFLAGS $XML_CFLAGS $SIGCPP_CFLAGS -Wall -D_REENTRANT $ARCH_CFLAGS" CFLAGS="$CXXFLAGS" ] ) #CFLAGS="$CPPFLAGS $FFTW_CFLAGS $JACK_CFLAGS $WX_CFLAGS $XML_CFLAGS -Wall -D_REENTRANT $ARCH_CFLAGS" #CXXFLAGS="$CFLAGS" #CXXFLAGS="-g -Wall $FFTW_CFLAGS $JACK_CFLAGS $WX_CFLAGS $XML_CFLAGS" LIBS="$LIBS $FFTW_LIBS $JACK_LIBS $WX_LIBS $XML_LIBS $SIGCPP_LIBS" AC_SUBST(FREQTWEAK_MAJOR_VERSION) AC_SUBST(FREQTWEAK_MINOR_VERSION) AC_SUBST(FREQTWEAK_MICRO_VERSION) AC_SUBST(FREQTWEAK_VERSION) AC_DEFINE_UNQUOTED(HELP_HTML_PATH, "${prefix}/share/${PACKAGE}/help", [Help path]) AC_OUTPUT([ Makefile src/Makefile src/version.h doc/Makefile ]) echo echo Now type \'make\' to build FreqTweak. echo freqtweak-0.7.2/install-sh0000755000175200017520000001270110711547364014512 0ustar develdevel#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else : fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else : fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else : fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 freqtweak-0.7.2/autogen.sh0000755000175200017520000000074411226173741014507 0ustar develdevel#!/bin/sh aclocal $ACLOCAL_FLAGS || { echo "aclocal \$ACLOCAL_FLAGS where \$ACLOCAL_FLAGS= failed, exiting..." exit 1 } autoheader || { echo "autoheader failed, exiting..." exit 1 } automake --add-missing --foreign || { echo "automake --add-missing --foreign failed, exiting..." exit 1 } autoconf || { echo "autoconf failed, exiting..." exit 1 } #echo "Running ./configure --enable-maintainer-mode $@..." #./configure --enable-maintainer-mode $@ freqtweak-0.7.2/missing0000755000175200017520000002403610711547364014111 0ustar develdevel#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program 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 General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1Help2man' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 freqtweak-0.7.2/mkinstalldirs0000755000175200017520000000341110711547364015312 0ustar develdevel#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case "${1}" in -h | --help | --h* ) # -h for help echo "${usage}" 1>&2; exit 0 ;; -m ) # -m PERM arg shift test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } dirmode="${1}" shift ;; -- ) shift; break ;; # stop option processing -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option * ) break ;; # first non-opt arg esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 3 # End: # mkinstalldirs ends here freqtweak-0.7.2/ft_preset_convert.py0000755000175200017520000001366211226173741016621 0ustar develdevel#!/usr/bin/env python # this script converts old (before 0.5.0) FreqTweak presets into # the new format in place. (the original preset files are left for backward # compatibility import sys,os,shutil,string def write_channel_node(wfile, info, pos): # writes out entire channel node with # known fixed modules and order wfile.write(' \n' % \ (pos, info['input_gain'], info['mix_ratio'], info['bypassed'], info['muted'])) wfile.write(' \n') wfile.write(' \n') wfile.write(' \n' % \ (info['freq_bypassed'], info['freq_linked'])) wfile.write(' \n') wfile.write(' \n') wfile.write(' \n') wfile.write(' \n') wfile.write(' \n' % \ (info['scale_bypassed'], info['scale_linked'])) wfile.write(' \n') wfile.write(' \n') wfile.write(' \n') wfile.write(' \n') wfile.write(' \n' % \ (info['inverse_gate_bypassed'], info['inverse_gate_linked'])) wfile.write(' \n') wfile.write(' \n') wfile.write(' \n' % \ (info['gate_bypassed'], info['gate_linked'])) wfile.write(' \n') wfile.write(' \n') wfile.write(' \n') wfile.write(' \n') wfile.write(' \n' % \ (info['delay_bypassed'], info['delay_linked'])) wfile.write(' \n') wfile.write(' \n') wfile.write(' \n' % \ (info['feedback_bypassed'], info['feedback_linked'])) wfile.write(' \n') wfile.write(' \n') wfile.write(' \n') wfile.write(' \n') wfile.write(' \n') for port in string.split(info['input_ports'], ','): wfile.write(' \n' % port) wfile.write(' \n') wfile.write(' \n') for port in string.split(info['output_ports'], ','): wfile.write(' \n' % port) wfile.write(' \n') wfile.write(' \n') # the main script follows preset_dir = os.path.join(os.getenv('HOME', '.'), '.freqtweak', 'presets') if len(sys.argv) > 1: preset_dir = sys.argv[1] try: os.chdir(preset_dir) except OSError, ex: print 'Error accessing preset directory %s' % preset_dir sys.exit(2) # each directory in the presets dir is a preset preset_names = os.listdir(preset_dir) for pname in preset_names: dirname = os.path.join(preset_dir, pname) if not os.path.isdir(dirname): continue os.chdir(dirname) if os.path.exists('config.xml'): print 'Already converted: %s' % pname continue elif not os.path.exists('config.0'): print 'No old preset in %s' % dirname continue orig_info = [] wfile = None try: wfile = open('config.xml', 'w+') except IOError: print 'error opening new %s/config.xml' % pname continue # write xml initial stuff wfile.write('\n') wfile.write('\n') for chan in range(4): if not os.path.exists('config.%d' % chan): break # copy filter files to new names shutil.copy('freq.%d.filter' % chan, '%d_0_freq.filter' % chan) shutil.copy('scale.%d.filter' % chan, '%d_1_scale.filter' % chan) shutil.copy('gate.%d.filter' % chan, '%d_2_gate.filter' % chan) shutil.copy('inverse_gate.%d.filter' % chan, '%d_2_inverse_gate.filter' % chan) shutil.copy('delay.%d.filter' % chan, '%d_3_delay.filter' % chan) shutil.copy('feedback.%d.filter' % chan, '%d_3_feedback.filter' % chan) # now parse config info = {} cfile = None try: cfile = open('config.%d' % chan, 'r') except IOError,ex: print "error opening config.%d" % chan continue lines = cfile.readlines() for line in lines: line = string.strip(line) if not line or line[0] == '#': continue try: key,val = string.split(line, '=', 1) except: continue info[key] = val if chan==0: # write params wfile.write(' \n' % \ (info['fft_size'], info['windowing'], info['update_speed'], info['oversamp'], info['tempo'], info['max_delay'])) wfile.write(' \n') # write Channel node write_channel_node(wfile, info, chan) wfile.write(' \n') wfile.write('\n') wfile.close() print 'Converted: %s' % pname freqtweak-0.7.2/Makefile.am0000644000175200017520000000111011226173741014526 0ustar develdevel# Copyright (C) 2002 Jesse Chappell # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. EXTRA_DIST = autogen.sh configure ft_preset_convert.py freqtweak.1 SUBDIRS = src doc man_MANS = freqtweak.1freqtweak-0.7.2/Makefile.in0000644000175200017520000004714611226200757014560 0ustar develdevel# Makefile.in generated by automake 1.7.9 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Copyright (C) 2002 Jesse Chappell # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ ARCH_486_FALSE = @ARCH_486_FALSE@ ARCH_486_TRUE = @ARCH_486_TRUE@ ARCH_586_FALSE = @ARCH_586_FALSE@ ARCH_586_TRUE = @ARCH_586_TRUE@ ARCH_686_FALSE = @ARCH_686_FALSE@ ARCH_686_TRUE = @ARCH_686_TRUE@ ARCH_CFLAGS = @ARCH_CFLAGS@ ARCH_PPC_FALSE = @ARCH_PPC_FALSE@ ARCH_PPC_TRUE = @ARCH_PPC_TRUE@ ARCH_TYPE = @ARCH_TYPE@ ARCH_ULTRA_FALSE = @ARCH_ULTRA_FALSE@ ARCH_ULTRA_TRUE = @ARCH_ULTRA_TRUE@ ARCH_X86_FALSE = @ARCH_X86_FALSE@ ARCH_X86_TRUE = @ARCH_X86_TRUE@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FFTW_CFLAGS = @FFTW_CFLAGS@ FFTW_LIBS = @FFTW_LIBS@ FREQTWEAK_MAJOR_VERSION = @FREQTWEAK_MAJOR_VERSION@ FREQTWEAK_MICRO_VERSION = @FREQTWEAK_MICRO_VERSION@ FREQTWEAK_MINOR_VERSION = @FREQTWEAK_MINOR_VERSION@ FREQTWEAK_VERSION = @FREQTWEAK_VERSION@ GREP = @GREP@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JACK_CFLAGS = @JACK_CFLAGS@ JACK_LIBS = @JACK_LIBS@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIGCPP_CFLAGS = @SIGCPP_CFLAGS@ SIGCPP_LIBS = @SIGCPP_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ WX_CONFIG = @WX_CONFIG@ WX_CONFIG0 = @WX_CONFIG0@ WX_CONFIG1 = @WX_CONFIG1@ WX_CONFIG2 = @WX_CONFIG2@ WX_CONFIG3 = @WX_CONFIG3@ WX_CONFIG4 = @WX_CONFIG4@ XML_CFLAGS = @XML_CFLAGS@ XML_LIBS = @XML_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ bindir = @bindir@ build_alias = @build_alias@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ EXTRA_DIST = autogen.sh configure ft_preset_convert.py freqtweak.1 SUBDIRS = src doc man_MANS = freqtweak.1 subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = DIST_SOURCES = NROFF = nroff MANS = $(man_MANS) RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \ ps-recursive install-info-recursive uninstall-info-recursive \ all-recursive install-data-recursive install-exec-recursive \ installdirs-recursive install-recursive uninstall-recursive \ check-recursive installcheck-recursive DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure AUTHORS \ COPYING ChangeLog INSTALL Makefile.am NEWS THANKS aclocal.m4 \ config.h.in configure configure.ac depcomp install-sh missing \ mkinstalldirs DIST_SUBDIRS = $(SUBDIRS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.ac cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) touch $(srcdir)/config.h.in distclean-hdr: -rm -f config.h stamp-h1 uninstall-info-am: man1dir = $(mandir)/man1 install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ETAGS = etags ETAGSFLAGS = CTAGS = ctags CTAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if (etags --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ else \ include_option=--include; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . distdir = $(PACKAGE)-$(VERSION) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) $(mkinstalldirs) $(distdir)/src @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist $(am__remove_distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ && rm -f $(distdir).tar.gz \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(MANS) config.h installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(man1dir) install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-man install-exec-am: install-info: install-info-recursive install-man: install-man1 installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-man uninstall-info: uninstall-info-recursive uninstall-man: uninstall-man1 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \ clean-generic clean-recursive ctags ctags-recursive dist \ dist-all dist-gzip distcheck distclean distclean-generic \ distclean-hdr distclean-recursive distclean-tags distcleancheck \ distdir distuninstallcheck dvi dvi-am dvi-recursive info \ info-am info-recursive install install-am install-data \ install-data-am install-data-recursive install-exec \ install-exec-am install-exec-recursive install-info \ install-info-am install-info-recursive install-man install-man1 \ install-recursive install-strip installcheck installcheck-am \ installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \ ps-recursive tags tags-recursive uninstall uninstall-am \ uninstall-info-am uninstall-info-recursive uninstall-man \ uninstall-man1 uninstall-recursive # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: freqtweak-0.7.2/config.h.in0000644000175200017520000000634311226173741014532 0ustar develdevel/* config.h.in. Generated from configure.ac by autoheader. */ /* Define if on a 486 platform */ #undef ARCH_486 /* Define if on a 586 platform */ #undef ARCH_586 /* Define if on a 686 platform */ #undef ARCH_686 /* Define if on a PPC platform */ #undef ARCH_PPC /* Define if on a SUN ULTRA platform */ #undef ARCH_ULTRA /* Define if on x86 platform */ #undef ARCH_X86 /* Use this otherwise */ #undef FPM_64BIT /* Define if we are on Intel */ #undef FPM_INTEL /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FFTW_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Have newer JACK connect call */ #undef HAVE_JACK_CLIENT_OPEN /* Define to 1 if you have the `fftw' library (-lfftw). */ #undef HAVE_LIBFFTW /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `rfftw' library (-lrfftw). */ #undef HAVE_LIBRFFTW /* Define to 1 if you have the `sfftw' library (-lsfftw). */ #undef HAVE_LIBSFFTW /* Define to 1 if you have the `srfftw' library (-lsrfftw). */ #undef HAVE_LIBSRFFTW /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the `pow' function. */ #undef HAVE_POW /* Define to 1 if you have the header file. */ #undef HAVE_RFFTW_H /* Define to 1 if you have the header file. */ #undef HAVE_SFFTW_H /* Define to 1 if you have the `sqrt' function. */ #undef HAVE_SQRT /* Define to 1 if you have the header file. */ #undef HAVE_SRFFTW_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_VALUES_H /* Help path */ #undef HELP_HTML_PATH /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Using FFTW3 */ #undef USING_FFTW3 /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `unsigned int' if does not define. */ #undef size_t freqtweak-0.7.2/AUTHORS0000644000175200017520000000016311226173741013551 0ustar develdevelAuthors of freqtweak. See also the files THANKS and ChangeLog. Jesse Chappell designed and implemented freqtweak. freqtweak-0.7.2/INSTALL0000644000175200017520000002065111226173741013536 0ustar develdevelFreqTweak Installation ======================= You will need to have the following packages installed: JACK ( >= 0.34 ) [ http://jackit.sourceforge.net ] FFTW (tested with 2.1.3 and 3.0) [ http://www.fftw.org ] wxGTK (tested with 2.2.x, 2.3.x, and 2.4.x) [ http://www.wxwindow.org ] libsigc++ >= 1.2 [ libsigc.sourceforge.net ] IMPORTANT NOTE: you will need to use FFTW with single precision. If configuring FFTW ( < 3) you will want to use "--enable-float --enable-type-prefix" If configuring FFTW3 you will want to use "--enable-float" The standard procedure should work fine: ./configure make [opt] make install If there are problems, PLEASE send a message to freqtweak-user@lists.sourceforge.net Generic Installation Instructions ================================= For more information specific to this package, please read the README file. This source code distribution is autoconfiguring and you should be able to compile it and install it without manual interventions such as editing Makefiles, configuration files, and so on. These are generic instructions for people who are not familiar with installing autoconfiguring software. The simplest way to compile this package is to enter the source code main directory and do the following: 1. Configure the source code by typing: % sh ./configure If you're planning to install the package into your home directory or to a location other than `/usr/local' then add the flag `--prefix=PATH' to `configure'. For example, if your home directory is `/home/luser' you can configure the package to install itself there by invoking: % sh ./configure --prefix=/home/luser While running, `configure' prints some messages telling which features is it checking for. 2. Compile the package by typing: % make Running `make' takes a while. If this is a very large package, now is the time to go make some coffee. 3. Some packages are bundled with self-tests for source-code verification. If this package includes such tests, you can optionally run them after compilation by typing % make check 4. Type `make install' to install the programs and any data files and documentation. Type `make uninstall' to undo the installation. During installation, the following files go to the following directories: Executables -> /prefix/bin Libraries -> /prefix/lib Public header files -> /prefix/include Man pages -> /prefix/man/man? Info files -> /prefix/info where `prefix' is either `/usr/local' or the PATH that you specified in the `--prefix' flag. If any of these directories do not presently exist, they will be created on demand. If you are installing in your home directory make sure that `/home/luser/bin' is in your path. If you're using the bash shell add this line at the end of your .cshrc file: PATH="/home/luser/bin:${PATH}" export PATH If you are using csh or tcsh, then use this line instead: setenv PATH /home/luser/bin:${PATH} By prepending your home directory to the rest of the PATH you can override systemwide installed software with your own custom installation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. Compiler configuration ====================== The `configure' shell script is responsible for choosing and configuring the compiler(s). The following options allow you to specify whether you want to enable or disable various debugging mechanisms: `--with-warnings' Make the compilers very picky about warnings. Try this whenever you write new code since it may catch a few bugs. This is not active by default because all too often warnings can be too picky and scare the end-user. `--disable-assert' Compile without using assertions. This results in faster code, but should not be used during developerment, or to run `make check' which depends on assertions. It should only be used for production runs on code that you believe is bug free. All programs are compiled with optimization level 2 by default (-O2). Occasionally that confuses the debugger when code is inlined. To disable optimization and enable debugging, set the shell environment variables CFLAGS, CXXFLAGS, FFLAGS to `-g'. On the bash shell, you can do this like this: $ export CFLAGS="-g" $ export CXXFLAGS="-g" $ export FFLAGS="-g" On the tcsh shell, use the `setenv' command instead: % setenv CFLAGS "-g" ...etc... For other shell, please consult your shell's documentation. Similarly, you can increase the optimization level by assigning these variables to "-g -O3". The following options allow you to reconsider the `configure' shell script's choice of Fortran compilers. `--with-f2c' Compile the Fortran code by translating it to C, even if a native Fortran compiler is available. A copy of the f2c translator should be bundled in the distribution. It will be compiled and then used to compile your Fortran code. `--with-g77' Compile the Fortran code with g77 even if a proprietary Fortran compiler is available `--with-f77=F77' Compile the Fortran code with the specified Fortran compiler. Depending on what languages the package uses, some of these options may or may not be available. To see what is available, type: % sh ./configure --help About the configure script ========================== The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. Advanced installation options. ============================== The `configure' script also understands the following more advanced options, to handle situations for which `--prefix' alone is not sufficient. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. freqtweak-0.7.2/ChangeLog0000644000175200017520000000000311226173741014244 0ustar develdevel* freqtweak-0.7.2/COPYING0000644000175200017520000004307611226173741013546 0ustar develdevel GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.