xiRetimer

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

commit
e6ca5f7bff309771dd60562e4f84af0a88329cdc
parent
8645579caaa9281e4dfd5fb7f19c59dac34c4fc9
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-12-26 10:47
rm deprecated wxT

Diffstat

M src/gui/retimer_wx.cpp 70 ++++++++++++++++++++++++++++++------------------------------
M src/gui/retimer_wx.h 6 +++---

2 files changed, 38 insertions, 38 deletions


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

@@ -23,16 +23,16 @@ MainFrame::MainFrame(wxWindow* parent, wxWindowID id, const wxString& title, con
   23    23 	m_menubar3 = new wxMenuBar(0);
   24    24 	m_file = new wxMenu();
   25    25 	wxMenuItem* m_open;
   26    -1 	m_open = new wxMenuItem(m_file, wxID_ANY, wxString(wxT("open")) + wxT('\t') + wxT("CTRL+f"), wxEmptyString, wxITEM_NORMAL);
   -1    26 	m_open = new wxMenuItem(m_file, wxID_ANY, wxString("open") + '\t' + "CTRL+f", wxEmptyString, wxITEM_NORMAL);
   27    27 	#ifdef ICONS_GNOME
   28    -1 	m_open->SetBitmap(wxBitmap(wxT("/usr/share/icons/gnome/16x16/actions/fileopen.png"), wxBITMAP_TYPE_ANY));
   -1    28 	m_open->SetBitmap(wxBitmap("/usr/share/icons/gnome/16x16/actions/fileopen.png", wxBITMAP_TYPE_ANY));
   29    29 	#endif
   30    30 	m_file->Append(m_open);
   31    31 
   32    32 	wxMenuItem* m_export;
   33    -1 	m_export = new wxMenuItem(m_file, wxID_ANY, wxString(wxT("export")) + wxT('\t') + wxT("CTRL+s"), wxEmptyString, wxITEM_NORMAL);
   -1    33 	m_export = new wxMenuItem(m_file, wxID_ANY, wxString("export") + '\t' + "CTRL+s", wxEmptyString, wxITEM_NORMAL);
   34    34 	#ifdef ICONS_GNOME
   35    -1 	m_export->SetBitmap(wxBitmap(wxT("/usr/share/icons/gnome/16x16/actions/document-save.png"), wxBITMAP_TYPE_ANY));
   -1    35 	m_export->SetBitmap(wxBitmap("/usr/share/icons/gnome/16x16/actions/document-save.png", wxBITMAP_TYPE_ANY));
   36    36 	#endif
   37    37 	m_file->Append(m_export);
   38    38 
@@ -40,9 +40,9 @@ MainFrame::MainFrame(wxWindow* parent, wxWindowID id, const wxString& title, con
   40    40 	m_separator6 = m_file->AppendSeparator();
   41    41 
   42    42 	wxMenuItem* m_prefs;
   43    -1 	m_prefs = new wxMenuItem(m_file, wxID_ANY, wxString(wxT("preferences")) + wxT('\t') + wxT("F5"), wxEmptyString, wxITEM_NORMAL);
   -1    43 	m_prefs = new wxMenuItem(m_file, wxID_ANY, wxString("preferences") + '\t' + "F5", wxEmptyString, wxITEM_NORMAL);
   44    44 	#ifdef ICONS_GNOME
   45    -1 	m_prefs->SetBitmap(wxBitmap(wxT("/usr/share/icons/gnome/16x16/actions/document-properties.png"), wxBITMAP_TYPE_ANY));
   -1    45 	m_prefs->SetBitmap(wxBitmap("/usr/share/icons/gnome/16x16/actions/document-properties.png", wxBITMAP_TYPE_ANY));
   46    46 	#endif
   47    47 	m_file->Append(m_prefs);
   48    48 
@@ -50,26 +50,26 @@ MainFrame::MainFrame(wxWindow* parent, wxWindowID id, const wxString& title, con
   50    50 	m_separator7 = m_file->AppendSeparator();
   51    51 
   52    52 	wxMenuItem* b_exit;
   53    -1 	b_exit = new wxMenuItem(m_file, wxID_ANY, wxString(wxT("Exit")) , wxEmptyString, wxITEM_NORMAL);
   -1    53 	b_exit = new wxMenuItem(m_file, wxID_ANY, wxString("Exit") , wxEmptyString, wxITEM_NORMAL);
   54    54 	#ifdef ICONS_GNOME
   55    -1 	b_exit->SetBitmap(wxBitmap(wxT("/usr/share/icons/gnome/16x16/actions/window-close.png"), wxBITMAP_TYPE_ANY));
   -1    55 	b_exit->SetBitmap(wxBitmap("/usr/share/icons/gnome/16x16/actions/window-close.png", wxBITMAP_TYPE_ANY));
   56    56 	#endif
   57    57 	m_file->Append(b_exit);
   58    58 
   59    -1 	m_menubar3->Append(m_file, wxT("File"));
   -1    59 	m_menubar3->Append(m_file, "File");
   60    60 
   61    61 	m_edit = new wxMenu();
   62    62 	wxMenuItem* m_play;
   63    -1 	m_play = new wxMenuItem(m_edit, wxID_ANY, wxString(wxT("play/pause")) + wxT('\t') + wxT("SPACE"), wxEmptyString, wxITEM_NORMAL);
   -1    63 	m_play = new wxMenuItem(m_edit, wxID_ANY, wxString("play/pause") + '\t' + "SPACE", wxEmptyString, wxITEM_NORMAL);
   64    64 	#ifdef ICONS_GNOME
   65    -1 	m_play->SetBitmap(wxBitmap(wxT("/usr/share/icons/gnome/16x16/actions/media-playback-start.png"), wxBITMAP_TYPE_ANY));
   -1    65 	m_play->SetBitmap(wxBitmap("/usr/share/icons/gnome/16x16/actions/media-playback-start.png", wxBITMAP_TYPE_ANY));
   66    66 	#endif
   67    67 	m_edit->Append(m_play);
   68    68 
   69    69 	wxMenuItem* m_start;
   70    -1 	m_start = new wxMenuItem(m_edit, wxID_ANY, wxString(wxT("start")) + wxT('\t') + wxT("CTRL+LEFT"), wxEmptyString, wxITEM_NORMAL);
   -1    70 	m_start = new wxMenuItem(m_edit, wxID_ANY, wxString("start") + '\t' + "CTRL+LEFT", wxEmptyString, wxITEM_NORMAL);
   71    71 	#ifdef ICONS_GNOME
   72    -1 	m_start->SetBitmap(wxBitmap(wxT("/usr/share/icons/gnome/16x16/actions/media-skip-backward.png"), wxBITMAP_TYPE_ANY));
   -1    72 	m_start->SetBitmap(wxBitmap("/usr/share/icons/gnome/16x16/actions/media-skip-backward.png", wxBITMAP_TYPE_ANY));
   73    73 	#endif
   74    74 	m_edit->Append(m_start);
   75    75 
@@ -77,30 +77,30 @@ MainFrame::MainFrame(wxWindow* parent, wxWindowID id, const wxString& title, con
   77    77 	m_separator8 = m_edit->AppendSeparator();
   78    78 
   79    79 	wxMenuItem* m_clear;
   80    -1 	m_clear = new wxMenuItem(m_edit, wxID_ANY, wxString(wxT("clear markers")) + wxT('\t') + wxT("CTRL+c"), wxEmptyString, wxITEM_NORMAL);
   -1    80 	m_clear = new wxMenuItem(m_edit, wxID_ANY, wxString("clear markers") + '\t' + "CTRL+c", wxEmptyString, wxITEM_NORMAL);
   81    81 	#ifdef ICONS_GNOME
   82    -1 	m_clear->SetBitmap(wxBitmap(wxT("/usr/share/icons/gnome/16x16/actions/edit-clear.png"), wxBITMAP_TYPE_ANY));
   -1    82 	m_clear->SetBitmap(wxBitmap("/usr/share/icons/gnome/16x16/actions/edit-clear.png", wxBITMAP_TYPE_ANY));
   83    83 	#endif
   84    84 	m_edit->Append(m_clear);
   85    85 
   86    86 	wxMenuItem* m_process;
   87    -1 	m_process = new wxMenuItem(m_edit, wxID_ANY, wxString(wxT("update audio data")) + wxT('\t') + wxT("CTRL+u"), wxEmptyString, wxITEM_NORMAL);
   -1    87 	m_process = new wxMenuItem(m_edit, wxID_ANY, wxString("update audio data") + '\t' + "CTRL+u", wxEmptyString, wxITEM_NORMAL);
   88    88 	#ifdef ICONS_GNOME
   89    -1 	m_process->SetBitmap(wxBitmap(wxT("/usr/share/icons/gnome/16x16/actions/stock_refresh.png"), wxBITMAP_TYPE_ANY));
   -1    89 	m_process->SetBitmap(wxBitmap("/usr/share/icons/gnome/16x16/actions/stock_refresh.png", wxBITMAP_TYPE_ANY));
   90    90 	#endif
   91    91 	m_edit->Append(m_process);
   92    92 
   93    -1 	m_menubar3->Append(m_edit, wxT("Edit"));
   -1    93 	m_menubar3->Append(m_edit, "Edit");
   94    94 
   95    95 	m_help = new wxMenu();
   96    96 	wxMenuItem* m_about;
   97    -1 	m_about = new wxMenuItem(m_help, wxID_ANY, wxString(wxT("about")) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL);
   -1    97 	m_about = new wxMenuItem(m_help, wxID_ANY, wxString("about") + '\t' + "F1", wxEmptyString, wxITEM_NORMAL);
   98    98 	#ifdef ICONS_GNOME
   99    -1 	m_about->SetBitmap(wxBitmap(wxT("/usr/share/icons/gnome/16x16/actions/help-about.png"), wxBITMAP_TYPE_ANY));
   -1    99 	m_about->SetBitmap(wxBitmap("/usr/share/icons/gnome/16x16/actions/help-about.png", wxBITMAP_TYPE_ANY));
  100   100 	#endif
  101   101 	m_help->Append(m_about);
  102   102 
  103    -1 	m_menubar3->Append(m_help, wxT("Help"));
   -1   103 	m_menubar3->Append(m_help, "Help");
  104   104 
  105   105 	this->SetMenuBar(m_menubar3);
  106   106 
@@ -155,11 +155,11 @@ AboutDialog::AboutDialog(wxWindow* parent, wxWindowID id, const wxString& title,
  155   155 	m_staticText7->Wrap(-1);
  156   156 	bSizer14->Add(m_staticText7, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
  157   157 
  158    -1 	m_staticText1 = new wxStaticText(this, wxID_ANY, wxT("Created by xi."), wxDefaultPosition, wxDefaultSize, 0);
   -1   158 	m_staticText1 = new wxStaticText(this, wxID_ANY, "Created by xi.", wxDefaultPosition, wxDefaultSize, 0);
  159   159 	m_staticText1->Wrap(-1);
  160   160 	bSizer14->Add(m_staticText1, 0, wxALIGN_CENTER|wxALL, 5);
  161   161 
  162    -1 	m_staticText2 = new wxStaticText(this, wxID_ANY, wxT("www.github.com/xi"), wxDefaultPosition, wxDefaultSize, 0);
   -1   162 	m_staticText2 = new wxStaticText(this, wxID_ANY, "www.github.com/xi", wxDefaultPosition, wxDefaultSize, 0);
  163   163 	m_staticText2->Wrap(-1);
  164   164 	bSizer14->Add(m_staticText2, 0, wxALIGN_CENTER|wxALL, 5);
  165   165 
@@ -168,7 +168,7 @@ AboutDialog::AboutDialog(wxWindow* parent, wxWindowID id, const wxString& title,
  168   168 	wxBoxSizer* bSizer7;
  169   169 	bSizer7 = new wxBoxSizer(wxVERTICAL);
  170   170 
  171    -1 	m_button1 = new wxButton(this, wxID_ANY, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0);
   -1   171 	m_button1 = new wxButton(this, wxID_ANY, "OK", wxDefaultPosition, wxDefaultSize, 0);
  172   172 	bSizer7->Add(m_button1, 0, wxALIGN_CENTER|wxALL, 5);
  173   173 
  174   174 	bSizer4->Add(bSizer7, 0, wxEXPAND, 5);
@@ -197,32 +197,32 @@ PrefsDialog::PrefsDialog(wxWindow* parent, wxWindowID id, const wxString& title,
  197   197 	fgSizer4->SetFlexibleDirection(wxBOTH);
  198   198 	fgSizer4->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
  199   199 
  200    -1 	l_intmode = new wxStaticText(this, wxID_ANY, wxT("Interpolation Mode"), wxDefaultPosition, wxDefaultSize, 0);
   -1   200 	l_intmode = new wxStaticText(this, wxID_ANY, "Interpolation Mode", wxDefaultPosition, wxDefaultSize, 0);
  201   201 	l_intmode->Wrap(-1);
  202   202 	fgSizer4->Add(l_intmode, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
  203   203 
  204    -1 	wxString c_intmodeChoices[] = { wxT("Linear"), wxT("Polynominal") };
   -1   204 	wxString c_intmodeChoices[] = { "Linear", "Polynominal" };
  205   205 	int c_intmodeNChoices = sizeof(c_intmodeChoices) / sizeof(wxString);
  206   206 	c_intmode = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, c_intmodeNChoices, c_intmodeChoices, 0);
  207   207 	c_intmode->SetSelection(0);
  208   208 	fgSizer4->Add(c_intmode, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
  209   209 
  210    -1 	l_showint = new wxStaticText(this, wxID_ANY, wxT("show interpolation curve"), wxDefaultPosition, wxDefaultSize, 0);
   -1   210 	l_showint = new wxStaticText(this, wxID_ANY, "show interpolation curve", wxDefaultPosition, wxDefaultSize, 0);
  211   211 	l_showint->Wrap(-1);
  212   212 	fgSizer4->Add(l_showint, 0, wxALL, 5);
  213   213 
  214   214 	m_showint = new wxCheckBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
  215   215 	fgSizer4->Add(m_showint, 0, wxALL, 5);
  216   216 
  217    -1 	l_stretchmode = new wxStaticText(this, wxID_ANY, wxT("Stretch Mode"), wxDefaultPosition, wxDefaultSize, 0);
   -1   217 	l_stretchmode = new wxStaticText(this, wxID_ANY, "Stretch Mode", wxDefaultPosition, wxDefaultSize, 0);
  218   218 	l_stretchmode->Wrap(-1);
  219   219 	fgSizer4->Add(l_stretchmode, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
  220   220 
  221   221 	// TODO
  222   222 #ifdef MODE_RUBBERBAND
  223    -1 	wxString c_stretchmodeChoices[] = { wxT("none"), wxT("RubberBand")};
   -1   223 	wxString c_stretchmodeChoices[] = { "none", "RubberBand"};
  224   224 #else
  225    -1 	wxString c_stretchmodeChoices[] = { wxT("none"), wxT("RubberBand (disabled)")};
   -1   225 	wxString c_stretchmodeChoices[] = { "none", "RubberBand (disabled")};
  226   226 #endif
  227   227 
  228   228 	int c_stretchmodeNChoices = sizeof(c_stretchmodeChoices) / sizeof(wxString);
@@ -230,14 +230,14 @@ PrefsDialog::PrefsDialog(wxWindow* parent, wxWindowID id, const wxString& title,
  230   230 	c_stretchmode->SetSelection(0);
  231   231 	fgSizer4->Add(c_stretchmode, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
  232   232 
  233    -1 	l_tempo = new wxStaticText(this, wxID_ANY, wxT("Tempo"), wxDefaultPosition, wxDefaultSize, 0);
   -1   233 	l_tempo = new wxStaticText(this, wxID_ANY, "Tempo", wxDefaultPosition, wxDefaultSize, 0);
  234   234 	l_tempo->Wrap(-1);
  235   235 	fgSizer4->Add(l_tempo, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
  236   236 
  237   237 	t_tempo = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER|wxTE_RIGHT);
  238   238 	fgSizer4->Add(t_tempo, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5);
  239   239 
  240    -1 	l_beatres = new wxStaticText(this, wxID_ANY, wxT("Beat Resolution"), wxDefaultPosition, wxDefaultSize, 0);
   -1   240 	l_beatres = new wxStaticText(this, wxID_ANY, "Beat Resolution", wxDefaultPosition, wxDefaultSize, 0);
  241   241 	l_beatres->Wrap(-1);
  242   242 	fgSizer4->Add(l_beatres, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5);
  243   243 
@@ -249,11 +249,11 @@ PrefsDialog::PrefsDialog(wxWindow* parent, wxWindowID id, const wxString& title,
  249   249 	wxBoxSizer* bSizer15;
  250   250 	bSizer15 = new wxBoxSizer(wxHORIZONTAL);
  251   251 
  252    -1 	b_OK = new wxButton(this, wxID_ANY, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0);
   -1   252 	b_OK = new wxButton(this, wxID_ANY, "OK", wxDefaultPosition, wxDefaultSize, 0);
  253   253 	bSizer15->Add(b_OK, 0, wxALL|wxALIGN_BOTTOM|wxALIGN_RIGHT, 5);
  254   254 
  255    -1 	b_Cancel = new wxButton(this, wxID_ANY, wxT("Cancel"), wxDefaultPosition, wxDefaultSize, 0);
  256    -1 	b_Cancel->SetToolTip(wxT("Escape"));
   -1   255 	b_Cancel = new wxButton(this, wxID_ANY, "Cancel", wxDefaultPosition, wxDefaultSize, 0);
   -1   256 	b_Cancel->SetToolTip("Escape");
  257   257 
  258   258 	bSizer15->Add(b_Cancel, 0, wxALIGN_BOTTOM|wxALIGN_RIGHT|wxALL, 5);
  259   259 

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

@@ -60,7 +60,7 @@ class MainFrame : public wxFrame
   60    60 		virtual void OnHelpClick(wxCommandEvent& event) { event.Skip(); }
   61    61 
   62    62 	public:
   63    -1 		MainFrame(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("xiRetimer"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(611,397), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL);
   -1    63 		MainFrame(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = "xiRetimer", const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(611,397), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL);
   64    64 		~MainFrame();
   65    65 };
   66    66 
@@ -79,7 +79,7 @@ class AboutDialog : public wxDialog
   79    79 		virtual void OnOKClick(wxCommandEvent& event) { event.Skip(); }
   80    80 
   81    81 	public:
   82    -1 		AboutDialog(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(159,135), long style = wxDEFAULT_DIALOG_STYLE);
   -1    82 		AboutDialog(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = "About", const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(159,135), long style = wxDEFAULT_DIALOG_STYLE);
   83    83 		~AboutDialog();
   84    84 };
   85    85 
@@ -112,7 +112,7 @@ class PrefsDialog : public wxDialog
  112   112 		virtual void OnCancelClick(wxCommandEvent& event) { event.Skip(); }
  113   113 
  114   114 	public:
  115    -1 		PrefsDialog(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Preferences"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(322,238), long style = wxDEFAULT_DIALOG_STYLE);
   -1   115 		PrefsDialog(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = "Preferences", const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(322,238), long style = wxDEFAULT_DIALOG_STYLE);
  116   116 		~PrefsDialog();
  117   117 };
  118   118