xiRetimer

fit recorded audio to a tempo
git clone https://git.ce9e.org/xiRetimer.git

commit
d65ed0428395f6ac6a3de7a03dad02a0e568cd75
parent
13903fcb6fedcb7bee7268e6fceb63b654f04a41
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2010-11-18 11:12
makefile update

Diffstat

M configure.ac 14 ++++++++------
M makefile.in 7 +++----
D src/gui/retimer_wx.cpp 276 ------------------------------------------------------------
D src/rbprocess.h 76 ------------------------------------------------------------
M src/sample.cpp 2 +-

5 files changed, 12 insertions, 363 deletions


diff --git a/configure.ac b/configure.ac

@@ -1,6 +1,11 @@
    1     1 AC_INIT([retimer], [0.2], [])
    2     2 AC_CONFIG_SRCDIR([src/playback.h])
    3     3 
   -1     4 VERSION=0.2
   -1     5 NAME=xiRetimer
   -1     6 AC_SUBST(VERSION)
   -1     7 AC_SUBST(NAME)
   -1     8 
    4     9 # Checks for programs.
    5    10 AC_PROG_CXX
    6    11 AC_PROG_CC
@@ -37,14 +42,11 @@ PKG_CHECK_MODULES([RubberBand],[rubberband >= 1.4],
   37    42 	 echo "  Compiling with RubberBand support"],
   38    43 	[ echo "  Compiling without RubberBand support!"])
   39    44 
   40    -1 
   41    -1 # Checks for header files.
   42    -1 
   43    45 # Checks for typedefs, structures, and compiler characteristics.
   44    46 AC_HEADER_STDBOOL
   45    47 
   46    -1 # Checks for library functions.
   47    -1 
   48    -1 AC_CONFIG_FILES([makefile])
   -1    48 AC_CONFIG_FILES([makefile
   -1    49 	src/gui/retimer_wx.cpp
   -1    50 	])
   49    51 AC_OUTPUT
   50    52 

diff --git a/makefile.in b/makefile.in

@@ -1,10 +1,9 @@
    1    -1 VERSION = 0.2
    2     1 CC      = /usr/bin/g++
    3    -1 CFLAGS  = @_CFLAGS@ -DVERSION=\"$(VERSION)\" `sdl-config --cflags` `pkg-config --cflags sndfile @_PKGC@` `wx-config --cppflags`
   -1     2 CFLAGS  = @_CFLAGS@ -DVERSION=\"@VERSION@\" `sdl-config --cflags` `pkg-config --cflags sndfile @_PKGC@` `wx-config --cppflags`
    4     3 LDFLAGS = `sdl-config --libs` `pkg-config --libs sndfile @_PKGC@` `wx-config --libs`
    5     4 
    6    -1 xiRetimer: .gui .back
    7    -1 	$(CC) -o xiRetimer *.o $(LDFLAGS)
   -1     5 @NAME@: .gui .back
   -1     6 	$(CC) -o @NAME@ *.o $(LDFLAGS)
    8     7 
    9     8 .gui: .back src/gui/*.cpp src/gui/*.h
   10     9 	$(CC) $(CFLAGS) -c src/gui/*.cpp src/gui/*.h

diff --git a/src/gui/retimer_wx.cpp b/src/gui/retimer_wx.cpp

@@ -1,276 +0,0 @@
    1    -1 ///////////////////////////////////////////////////////////////////////////
    2    -1 // C++ code generated with wxFormBuilder (version Dec 21 2009)
    3    -1 // http://www.wxformbuilder.org/
    4    -1 //
    5    -1 // PLEASE DO "NOT" EDIT THIS FILE!
    6    -1 ///////////////////////////////////////////////////////////////////////////
    7    -1 // sorry guys, I edited it
    8    -1 
    9    -1 #include "retimer_wx.h"
   10    -1 
   11    -1 ///////////////////////////////////////////////////////////////////////////
   12    -1 
   13    -1 MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
   14    -1 {
   15    -1 wxInitAllImageHandlers();
   16    -1 	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
   17    -1 	
   18    -1 	wxBoxSizer* bSizer3;
   19    -1 	bSizer3 = new wxBoxSizer( wxVERTICAL );
   20    -1 	
   21    -1 	this->SetSizer( bSizer3 );
   22    -1 	this->Layout();
   23    -1 	m_statusBar1 = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
   24    -1 	m_menubar3 = new wxMenuBar( 0 );
   25    -1 	m_file = new wxMenu();
   26    -1 	wxMenuItem* m_open;
   27    -1 	m_open = new wxMenuItem( m_file, wxID_ANY, wxString( wxT("open") ) + wxT('\t') + wxT("CTRL+f"), wxEmptyString, wxITEM_NORMAL );
   28    -1 	#ifdef ICONS_GNOME
   29    -1 	m_open->SetBitmap( wxBitmap( wxT("/usr/share/icons/gnome/16x16/actions/fileopen.png"), wxBITMAP_TYPE_ANY ) );
   30    -1 	#endif
   31    -1 	m_file->Append( m_open );
   32    -1 	
   33    -1 	wxMenuItem* m_export;
   34    -1 	m_export = new wxMenuItem( m_file, wxID_ANY, wxString( wxT("export") ) + wxT('\t') + wxT("CTRL+s"), wxEmptyString, wxITEM_NORMAL );
   35    -1 	#ifdef ICONS_GNOME
   36    -1 	m_export->SetBitmap( wxBitmap( wxT("/usr/share/icons/gnome/16x16/actions/document-save.png"), wxBITMAP_TYPE_ANY ) );
   37    -1 	#endif
   38    -1 	m_file->Append( m_export );
   39    -1 	
   40    -1 	wxMenuItem* m_separator6;
   41    -1 	m_separator6 = m_file->AppendSeparator();
   42    -1 	
   43    -1 	wxMenuItem* m_prefs;
   44    -1 	m_prefs = new wxMenuItem( m_file, wxID_ANY, wxString( wxT("preferences") ) + wxT('\t') + wxT("F5"), wxEmptyString, wxITEM_NORMAL );
   45    -1 	#ifdef ICONS_GNOME
   46    -1 	m_prefs->SetBitmap( wxBitmap( wxT("/usr/share/icons/gnome/16x16/actions/document-properties.png"), wxBITMAP_TYPE_ANY ) );
   47    -1 	#endif
   48    -1 	m_file->Append( m_prefs );
   49    -1 	
   50    -1 	wxMenuItem* m_separator7;
   51    -1 	m_separator7 = m_file->AppendSeparator();
   52    -1 	
   53    -1 	wxMenuItem* b_exit;
   54    -1 	b_exit = new wxMenuItem( m_file, wxID_ANY, wxString( wxT("Exit") ) , wxEmptyString, wxITEM_NORMAL );
   55    -1 	#ifdef ICONS_GNOME
   56    -1 	b_exit->SetBitmap( wxBitmap( wxT("/usr/share/icons/gnome/16x16/actions/window-close.png"), wxBITMAP_TYPE_ANY ) );
   57    -1 	#endif
   58    -1 	m_file->Append( b_exit );
   59    -1 	
   60    -1 	m_menubar3->Append( m_file, wxT("File") );
   61    -1 	
   62    -1 	m_edit = new wxMenu();
   63    -1 	wxMenuItem* m_play;
   64    -1 	m_play = new wxMenuItem( m_edit, wxID_ANY, wxString( wxT("play/pause") ) + wxT('\t') + wxT("SPACE"), wxEmptyString, wxITEM_NORMAL );
   65    -1 	#ifdef ICONS_GNOME
   66    -1 	m_play->SetBitmap( wxBitmap( wxT("/usr/share/icons/gnome/16x16/actions/media-playback-start.png"), wxBITMAP_TYPE_ANY ) );
   67    -1 	#endif
   68    -1 	m_edit->Append( m_play );
   69    -1 	
   70    -1 	wxMenuItem* m_start;
   71    -1 	m_start = new wxMenuItem( m_edit, wxID_ANY, wxString( wxT("start") ) + wxT('\t') + wxT("CTRL+LEFT"), wxEmptyString, wxITEM_NORMAL );
   72    -1 	#ifdef ICONS_GNOME
   73    -1 	m_start->SetBitmap( wxBitmap( wxT("/usr/share/icons/gnome/16x16/actions/media-skip-backward.png"), wxBITMAP_TYPE_ANY ) );
   74    -1 	#endif
   75    -1 	m_edit->Append( m_start );
   76    -1 	
   77    -1 	wxMenuItem* m_separator8;
   78    -1 	m_separator8 = m_edit->AppendSeparator();
   79    -1 	
   80    -1 	wxMenuItem* m_clear;
   81    -1 	m_clear = new wxMenuItem( m_edit, wxID_ANY, wxString( wxT("clear markers") ) + wxT('\t') + wxT("CTRL+c"), wxEmptyString, wxITEM_NORMAL );
   82    -1 	#ifdef ICONS_GNOME
   83    -1 	m_clear->SetBitmap( wxBitmap( wxT("/usr/share/icons/gnome/16x16/actions/edit-clear.png"), wxBITMAP_TYPE_ANY ) );
   84    -1 	#endif
   85    -1 	m_edit->Append( m_clear );
   86    -1 	
   87    -1 	wxMenuItem* m_process;
   88    -1 	m_process = new wxMenuItem( m_edit, wxID_ANY, wxString( wxT("update audio data") ) + wxT('\t') + wxT("CTRL+u"), wxEmptyString, wxITEM_NORMAL );
   89    -1 	#ifdef ICONS_GNOME
   90    -1 	m_process->SetBitmap( wxBitmap( wxT("/usr/share/icons/gnome/16x16/actions/stock_refresh.png"), wxBITMAP_TYPE_ANY ) );
   91    -1 	#endif
   92    -1 	m_edit->Append( m_process );
   93    -1 	
   94    -1 	m_menubar3->Append( m_edit, wxT("Edit") );
   95    -1 	
   96    -1 	m_help = new wxMenu();
   97    -1 	wxMenuItem* m_about;
   98    -1 	m_about = new wxMenuItem( m_help, wxID_ANY, wxString( wxT("about") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL );
   99    -1 	#ifdef ICONS_GNOME
  100    -1 	m_about->SetBitmap( wxBitmap( wxT("/usr/share/icons/gnome/16x16/actions/help-about.png"), wxBITMAP_TYPE_ANY ) );
  101    -1 	#endif
  102    -1 	m_help->Append( m_about );
  103    -1 	
  104    -1 	m_menubar3->Append( m_help, wxT("Help") );
  105    -1 	
  106    -1 	this->SetMenuBar( m_menubar3 );
  107    -1 	
  108    -1 	
  109    -1 	// Connect Events
  110    -1 	this->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( MainFrame::OnLeftDClick ) );
  111    -1 	this->Connect( wxEVT_LEFT_DOWN, wxMouseEventHandler( MainFrame::OnLeftDown ) );
  112    -1 	this->Connect( wxEVT_LEFT_UP, wxMouseEventHandler( MainFrame::OnLeftUp ) );
  113    -1 	this->Connect( wxEVT_MOTION, wxMouseEventHandler( MainFrame::OnMotion ) );
  114    -1 	this->Connect( wxEVT_PAINT, wxPaintEventHandler( MainFrame::OnPaint ) );
  115    -1 	this->Connect( wxEVT_SIZE, wxSizeEventHandler( MainFrame::OnSize ) );
  116    -1 	this->Connect( m_open->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnOpenClick ) );
  117    -1 	this->Connect( m_export->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnExportClick ) );
  118    -1 	this->Connect( m_prefs->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnPrefsClick ) );
  119    -1 	this->Connect( b_exit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnExitClick ) );
  120    -1 	this->Connect( m_play->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnPlayClick ) );
  121    -1 	this->Connect( m_start->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnStartClick ) );
  122    -1 	this->Connect( m_clear->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnClearClick ) );
  123    -1 	this->Connect( m_process->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnProcessClick ) );
  124    -1 	this->Connect( m_about->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnHelpClick ) );
  125    -1 }
  126    -1 
  127    -1 MainFrame::~MainFrame()
  128    -1 {
  129    -1 	// Disconnect Events
  130    -1 	this->Disconnect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( MainFrame::OnLeftDClick ) );
  131    -1 	this->Disconnect( wxEVT_LEFT_DOWN, wxMouseEventHandler( MainFrame::OnLeftDown ) );
  132    -1 	this->Disconnect( wxEVT_LEFT_UP, wxMouseEventHandler( MainFrame::OnLeftUp ) );
  133    -1 	this->Disconnect( wxEVT_MOTION, wxMouseEventHandler( MainFrame::OnMotion ) );
  134    -1 	this->Disconnect( wxEVT_PAINT, wxPaintEventHandler( MainFrame::OnPaint ) );
  135    -1 	this->Disconnect( wxEVT_SIZE, wxSizeEventHandler( MainFrame::OnSize ) );
  136    -1 	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnOpenClick ) );
  137    -1 	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnExportClick ) );
  138    -1 	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnPrefsClick ) );
  139    -1 	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnExitClick ) );
  140    -1 	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnPlayClick ) );
  141    -1 	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnStartClick ) );
  142    -1 	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnClearClick ) );
  143    -1 	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnProcessClick ) );
  144    -1 	this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnHelpClick ) );
  145    -1 }
  146    -1 
  147    -1 AboutDialog::AboutDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
  148    -1 {
  149    -1 	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
  150    -1 	
  151    -1 	wxBoxSizer* bSizer4;
  152    -1 	bSizer4 = new wxBoxSizer( wxVERTICAL );
  153    -1 	
  154    -1 	wxBoxSizer* bSizer14;
  155    -1 	bSizer14 = new wxBoxSizer( wxVERTICAL );
  156    -1 	
  157    -1 	m_staticText7 = new wxStaticText( this, wxID_ANY, wxT("xiRetimer v0.2"), wxDefaultPosition, wxDefaultSize, 0 );
  158    -1 	m_staticText7->Wrap( -1 );
  159    -1 	bSizer14->Add( m_staticText7, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
  160    -1 	
  161    -1 	m_staticText1 = new wxStaticText( this, wxID_ANY, wxT("Created by xi."), wxDefaultPosition, wxDefaultSize, 0 );
  162    -1 	m_staticText1->Wrap( -1 );
  163    -1 	bSizer14->Add( m_staticText1, 0, wxALIGN_CENTER|wxALL, 5 );
  164    -1 	
  165    -1 	m_staticText2 = new wxStaticText( this, wxID_ANY, wxT("www.github.com/xi"), wxDefaultPosition, wxDefaultSize, 0 );
  166    -1 	m_staticText2->Wrap( -1 );
  167    -1 	bSizer14->Add( m_staticText2, 0, wxALIGN_CENTER|wxALL, 5 );
  168    -1 	
  169    -1 	bSizer4->Add( bSizer14, 1, wxEXPAND, 5 );
  170    -1 	
  171    -1 	wxBoxSizer* bSizer7;
  172    -1 	bSizer7 = new wxBoxSizer( wxVERTICAL );
  173    -1 	
  174    -1 	m_button1 = new wxButton( this, wxID_ANY, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0 );
  175    -1 	bSizer7->Add( m_button1, 0, wxALIGN_CENTER|wxALL, 5 );
  176    -1 	
  177    -1 	bSizer4->Add( bSizer7, 0, wxEXPAND, 5 );
  178    -1 	
  179    -1 	this->SetSizer( bSizer4 );
  180    -1 	this->Layout();
  181    -1 	
  182    -1 	// Connect Events
  183    -1 	m_button1->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDialog::OnOKClick ), NULL, this );
  184    -1 }
  185    -1 
  186    -1 AboutDialog::~AboutDialog()
  187    -1 {
  188    -1 	// Disconnect Events
  189    -1 	m_button1->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDialog::OnOKClick ), NULL, this );
  190    -1 }
  191    -1 
  192    -1 PrefsDialog::PrefsDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
  193    -1 {
  194    -1 	this->SetSizeHints( wxDefaultSize, wxDefaultSize );
  195    -1 	
  196    -1 	wxBoxSizer* bSizer5;
  197    -1 	bSizer5 = new wxBoxSizer( wxVERTICAL );
  198    -1 	
  199    -1 	wxFlexGridSizer* fgSizer4;
  200    -1 	fgSizer4 = new wxFlexGridSizer( 2, 2, 0, 0 );
  201    -1 	fgSizer4->AddGrowableCol( 1 );
  202    -1 	fgSizer4->SetFlexibleDirection( wxBOTH );
  203    -1 	fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
  204    -1 	
  205    -1 	l_intmode = new wxStaticText( this, wxID_ANY, wxT("Interpolation Mode"), wxDefaultPosition, wxDefaultSize, 0 );
  206    -1 	l_intmode->Wrap( -1 );
  207    -1 	fgSizer4->Add( l_intmode, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
  208    -1 	
  209    -1 	wxString c_intmodeChoices[] = { wxT("Linear") };
  210    -1 	int c_intmodeNChoices = sizeof( c_intmodeChoices ) / sizeof( wxString );
  211    -1 	c_intmode = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, c_intmodeNChoices, c_intmodeChoices, 0 );
  212    -1 	c_intmode->SetSelection( 0 );
  213    -1 	fgSizer4->Add( c_intmode, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
  214    -1 	
  215    -1 	l_stretchmode = new wxStaticText( this, wxID_ANY, wxT("Stretch Mode"), wxDefaultPosition, wxDefaultSize, 0 );
  216    -1 	l_stretchmode->Wrap( -1 );
  217    -1 	fgSizer4->Add( l_stretchmode, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
  218    -1 	
  219    -1         // TODO #ifdef MODE_RUBBERBAND
  220    -1 	wxString c_stretchmodeChoices[] = { wxT("none"), wxT("RubberBand") };
  221    -1 	int c_stretchmodeNChoices = sizeof( c_stretchmodeChoices ) / sizeof( wxString );
  222    -1 	c_stretchmode = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, c_stretchmodeNChoices, c_stretchmodeChoices, 0 );
  223    -1 	c_stretchmode->SetSelection( 0 );
  224    -1 	fgSizer4->Add( c_stretchmode, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
  225    -1 	
  226    -1 	l_tempo = new wxStaticText( this, wxID_ANY, wxT("Tempo"), wxDefaultPosition, wxDefaultSize, 0 );
  227    -1 	l_tempo->Wrap( -1 );
  228    -1 	fgSizer4->Add( l_tempo, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
  229    -1 	
  230    -1 	t_tempo = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_RIGHT );
  231    -1 	fgSizer4->Add( t_tempo, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
  232    -1 	
  233    -1 	l_beatres = new wxStaticText( this, wxID_ANY, wxT("Beat Resolution"), wxDefaultPosition, wxDefaultSize, 0 );
  234    -1 	l_beatres->Wrap( -1 );
  235    -1 	fgSizer4->Add( l_beatres, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
  236    -1 	
  237    -1 	t_beatres = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_RIGHT );
  238    -1 	fgSizer4->Add( t_beatres, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
  239    -1 	
  240    -1 	bSizer5->Add( fgSizer4, 1, wxEXPAND, 5 );
  241    -1 	
  242    -1 	wxBoxSizer* bSizer15;
  243    -1 	bSizer15 = new wxBoxSizer( wxHORIZONTAL );
  244    -1 	
  245    -1 	b_OK = new wxButton( this, wxID_ANY, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0 );
  246    -1 	bSizer15->Add( b_OK, 0, wxALL|wxALIGN_BOTTOM|wxALIGN_RIGHT, 5 );
  247    -1 	
  248    -1 	b_Cancel = new wxButton( this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
  249    -1 	b_Cancel->SetToolTip( wxT("Escape") );
  250    -1 	
  251    -1 	bSizer15->Add( b_Cancel, 0, wxALIGN_BOTTOM|wxALIGN_RIGHT|wxALL, 5 );
  252    -1 	
  253    -1 	bSizer5->Add( bSizer15, 0, wxALIGN_RIGHT, 5 );
  254    -1 	
  255    -1 	this->SetSizer( bSizer5 );
  256    -1 	this->Layout();
  257    -1 	
  258    -1 	// Connect Events
  259    -1 	c_intmode->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PrefsDialog::OnIntModeChange ), NULL, this );
  260    -1 	c_stretchmode->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PrefsDialog::OnStretchModeChange ), NULL, this );
  261    -1 	t_tempo->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( PrefsDialog::OnTempoEnter ), NULL, this );
  262    -1 	t_beatres->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( PrefsDialog::OnBeatResEnter ), NULL, this );
  263    -1 	b_OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PrefsDialog::OnOKClick ), NULL, this );
  264    -1 	b_Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PrefsDialog::OnCancelClick ), NULL, this );
  265    -1 }
  266    -1 
  267    -1 PrefsDialog::~PrefsDialog()
  268    -1 {
  269    -1 	// Disconnect Events
  270    -1 	c_intmode->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PrefsDialog::OnIntModeChange ), NULL, this );
  271    -1 	c_stretchmode->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PrefsDialog::OnStretchModeChange ), NULL, this );
  272    -1 	t_tempo->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( PrefsDialog::OnTempoEnter ), NULL, this );
  273    -1 	t_beatres->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( PrefsDialog::OnBeatResEnter ), NULL, this );
  274    -1 	b_OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PrefsDialog::OnOKClick ), NULL, this );
  275    -1 	b_Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PrefsDialog::OnCancelClick ), NULL, this );
  276    -1 }

diff --git a/src/rbprocess.h b/src/rbprocess.h

@@ -1,76 +0,0 @@
    1    -1 #ifndef __RBPROCESS_H
    2    -1 #define __RBPROCESS_H
    3    -1 
    4    -1 #include "marker.h"
    5    -1 #include "sample.h"
    6    -1 
    7    -1 #ifdef MODE_RUBBERBAND
    8    -1 
    9    -1 #include <rubberband/RubberBandStretcher.h>
   10    -1 #include <map>
   11    -1 
   12    -1 /*
   13    -1 this is called by sample.process()
   14    -1 this uses the rubberband library
   15    -1 */
   16    -1 
   17    -1 int RBprocess(int olength, float* data, Marker* marker, Sample* sample, int n=1) {
   18    -1 
   19    -1   int length=sample->getLength();
   20    -1   int ostart=int(marker->getOld(0)*olength);
   21    -1   if (ostart<0) ostart=0;
   22    -1   int olength2=int(marker->getOld(marker->getLength()-1)*olength)-ostart;
   23    -1   if (olength2>olength-ostart) olength2=olength-ostart;
   24    -1 
   25    -1   float **ibuf = new float *[1];
   26    -1   ibuf[0]=new float[olength2];
   27    -1   for (int i=0; i<olength2; ++i) {
   28    -1     ibuf[0][i]=sample->getOld((ostart+i)/(float)olength);
   29    -1   }
   30    -1 
   31    -1   float **obuf = new float *[1];
   32    -1   obuf[0]=data;
   33    -1 
   34    -1   RubberBand::RubberBandStretcher ts(44100, 1, 0, 1);
   35    -1   // map
   36    -1   std::map<unsigned int, unsigned int> fmap;
   37    -1   for (int i=0; i<length; i+=1024) {
   38    -1     float old= marker->nnew2new(marker->new2old(i/(float)length));
   39    -1     fmap[int(old*olength)-ostart]=int(i);
   40    -1   }
   41    -1   ts.setKeyFrameMap(fmap);
   42    -1 
   43    -1   sample->setFinished(0.03);
   44    -1   ts.study(ibuf, olength2, true);
   45    -1   ts.setMaxProcessSize(olength2);
   46    -1   int a1=-1;
   47    -1   int a2=0;
   48    -1   sample->setFinished(0.06);
   49    -1   ts.process(ibuf, olength2, true);
   50    -1   sample->setFinished(0.9);
   51    -1 
   52    -1   int avail=ts.available();
   53    -1   if (avail>length) avail=length;
   54    -1   ts.retrieve(obuf, avail);
   55    -1 
   56    -1   for (int j=0; j<avail; ++j) {
   57    -1     float value = obuf[0][j];
   58    -1     if (value > 1.f) value = 1.f;
   59    -1     if (value < -1.f) value = -1.f;
   60    -1     data[j] = value;
   61    -1   }
   62    -1 
   63    -1   for (int i=avail; i<length; ++i) {
   64    -1     data[i]=0;
   65    -1   }
   66    -1 
   67    -1   delete[] ibuf[0];
   68    -1   delete[] ibuf;
   69    -1   delete[] obuf;
   70    -1 
   71    -1   return 0;
   72    -1 }
   73    -1 
   74    -1 #endif
   75    -1 
   76    -1 #endif

diff --git a/src/sample.cpp b/src/sample.cpp

@@ -1,7 +1,7 @@
    1     1 #include "sample.h"
    2     2 #include <pthread.h>
    3     3 
    4    -1 #include "rbprocess.h"
   -1     4 #include "rbprocess.cpp"
    5     5 
    6     6 Sample::Sample(Marker* m) {
    7     7   marker=m;