mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-26 15:23:48 +01:00
fix the line endings on this file, and set svn:eol-style to native so they stay fixed
This commit is contained in:
@@ -1,301 +1,301 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
Audacity(R) is copyright (c) 1999-2008 Audacity Team.
|
||||
License: GPL v2. See License.txt.
|
||||
|
||||
ScoreAlignDialog.cpp
|
||||
<TODO: authors>
|
||||
|
||||
******************************************************************//**
|
||||
|
||||
\class ScoreAlignDialog
|
||||
\brief ScoreAlignDialog is <TODO>.
|
||||
|
||||
It <TODO: description>
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
#include "../Audacity.h"
|
||||
#include "../Experimental.h"
|
||||
|
||||
#ifdef EXPERIMENTAL_SCOREALIGN
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/brush.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/dcmemory.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/file.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/statusbr.h>
|
||||
#endif
|
||||
|
||||
#include <fstream>
|
||||
#include <wx/dialog.h>
|
||||
#include "../Prefs.h"
|
||||
#include "../ShuttleGui.h"
|
||||
#include "allegro.h"
|
||||
#include "audioreader.h"
|
||||
#include "scorealign.h"
|
||||
#include "scorealign-glue.h"
|
||||
#include "ScoreAlignDialog.h"
|
||||
|
||||
static ScoreAlignDialog *gScoreAlignDialog = NULL;
|
||||
|
||||
//IMPLEMENT_CLASS(ScoreAlignDialog, wxDialog)
|
||||
|
||||
ScoreAlignDialog::ScoreAlignDialog(wxWindow *parent, ScoreAlignParams ¶ms)
|
||||
: wxDialog(parent, -1, _("Align MIDI to Audio"),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE)
|
||||
{
|
||||
gScoreAlignDialog = this; // Allows anyone to close dialog by calling
|
||||
// CloseScoreAlignDialog()
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/FramePeriod"), &p.mFramePeriod,
|
||||
float(SA_DFT_FRAME_PERIOD));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/WindowSize"), &p.mWindowSize,
|
||||
float(SA_DFT_WINDOW_SIZE));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/SilenceThreshold"),
|
||||
&p.mSilenceThreshold, float(SA_DFT_SILENCE_THRESHOLD));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/ForceFinalAlignment"),
|
||||
&p.mForceFinalAlignment, float(SA_DFT_FORCE_FINAL_ALIGNMENT));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/IgnoreSilence"),
|
||||
&p.mIgnoreSilence, float(SA_DFT_IGNORE_SILENCE));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/PresmoothTime"), &p.mPresmoothTime,
|
||||
float(SA_DFT_PRESMOOTH_TIME));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/LineTime"), &p.mLineTime,
|
||||
float(SA_DFT_LINE_TIME));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/SmoothTime"), &p.mSmoothTime,
|
||||
float(SA_DFT_SMOOTH_TIME));
|
||||
|
||||
//wxButton *ok = new wxButton(this, wxID_OK, _("OK"));
|
||||
//wxButton *cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
|
||||
//wxSlider *sl = new wxSlider(this, ID_SLIDER, 0, 0, 100,
|
||||
// wxDefaultPosition, wxSize(20, 124),
|
||||
// wxSL_HORIZONTAL);
|
||||
|
||||
ShuttleGui S(this, eIsCreating);
|
||||
//ok->SetDefault();
|
||||
|
||||
S.SetBorder(5);
|
||||
S.StartVerticalLay(true);
|
||||
S.StartStatic(wxT("Align MIDI to Audio"));
|
||||
S.StartMultiColumn(3, wxEXPAND | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStretchyCol(1);
|
||||
|
||||
mFramePeriodLabel = S.AddVariableText(_("Frame Period")+wxString(wxT(":")), true,
|
||||
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mFramePeriodSlider = S.Id(ID_FRAMEPERIOD).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mFramePeriod * 100 + 0.5), /*max*/ 50, /*min*/ 5);
|
||||
S.SetSizeHints(300, -1);
|
||||
mFramePeriodSlider->SetName(_("Frame Period"));
|
||||
mFramePeriodText = S.AddVariableText(SA_DFT_FRAME_PERIOD_TEXT, true,
|
||||
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
mWindowSizeLabel = S.AddVariableText(_("Window Size")+wxString(wxT(":")), true,
|
||||
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mWindowSizeSlider = S.Id(ID_WINDOWSIZE).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mWindowSize * 100 + 0.5), /*max*/ 100, /*min*/ 5);
|
||||
mWindowSizeSlider->SetName(_("Window Size"));
|
||||
mWindowSizeText = S.AddVariableText(SA_DFT_WINDOW_SIZE_TEXT, true,
|
||||
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
mForceFinalAlignmentCheckBox = S.Id(ID_FORCEFINALALIGNMENT).AddCheckBox(
|
||||
wxT("Force Final Alignment"),
|
||||
(p.mForceFinalAlignment ? wxT("true") : wxT("false")));
|
||||
mForceFinalAlignmentCheckBox->SetName(_("Force Final Alignment"));
|
||||
mIgnoreSilenceCheckBox = S.Id(ID_IGNORESILENCE).AddCheckBox(
|
||||
wxT("Ignore Silence at Beginnings and Endings"),
|
||||
(p.mIgnoreSilence ? wxT("true") : wxT("false")));
|
||||
mIgnoreSilenceCheckBox->SetName(
|
||||
_("Ignore Silence at Beginnings and Endings"));
|
||||
// need a third column after checkboxes:
|
||||
S.AddVariableText(wxT(""), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
mSilenceThresholdLabel = S.AddVariableText(_("Silence Threshold:"),
|
||||
true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mSilenceThresholdSlider = S.Id(ID_SILENCETHRESHOLD).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mSilenceThreshold * 1000 + 0.5), /*max*/ 500);
|
||||
mSilenceThresholdSlider->SetName(_("Silence Threshold"));
|
||||
mSilenceThresholdText = S.AddVariableText(SA_DFT_SILENCE_THRESHOLD_TEXT,
|
||||
true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
/* i18n-hint: The English would be clearer if it had 'Duration' rather than 'Time'
|
||||
This is a new experimental effect, and until we have it documented in the user
|
||||
manual we don't have a clear description of what this parameter does.
|
||||
It is OK to leave it in English. */
|
||||
mPresmoothLabel = S.AddVariableText(_("Presmooth Time")+wxString(wxT(":")), true,
|
||||
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mPresmoothSlider = S.Id(ID_PRESMOOTH).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mPresmoothTime * 100 + 0.5), /*max*/ 500);
|
||||
mPresmoothSlider->SetName(_("Presmooth Time"));
|
||||
mPresmoothText = S.AddVariableText(SA_DFT_PRESMOOTH_TIME_TEXT, true,
|
||||
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
/* i18n-hint: The English would be clearer if it had 'Duration' rather than 'Time'
|
||||
This is a new experimental effect, and until we have it documented in the user
|
||||
manual we don't have a clear description of what this parameter does.
|
||||
It is OK to leave it in English. */
|
||||
mLineTimeLabel = S.AddVariableText(_("Line Time")+wxString(wxT(":")), true,
|
||||
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mLineTimeSlider = S.Id(ID_LINETIME).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mLineTime * 100 + 0.5), /*max*/ 500);
|
||||
mLineTimeSlider->SetName(_("Line Time"));
|
||||
mLineTimeText = S.AddVariableText(SA_DFT_LINE_TIME_TEXT, true,
|
||||
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
/* i18n-hint: The English would be clearer if it had 'Duration' rather than 'Time'
|
||||
This is a new experimental effect, and until we have it documented in the user
|
||||
manual we don't have a clear description of what this parameter does.
|
||||
It is OK to leave it in English. */
|
||||
mSmoothTimeLabel = S.AddVariableText(_("Smooth Time")+wxString(wxT(":")), true,
|
||||
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mSmoothTimeSlider = S.Id(ID_SMOOTHTIME).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mSmoothTime * 100 + 0.5), /*max*/ 500);
|
||||
mSmoothTimeSlider->SetName(_("Smooth Time"));
|
||||
mSmoothTimeText = S.AddVariableText(SA_DFT_SMOOTH_TIME_TEXT, true,
|
||||
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
S.EndMultiColumn();
|
||||
S.EndStatic();
|
||||
|
||||
mDefaultButton = new wxButton(this, ID_DEFAULT, _("Use Defaults"));
|
||||
mDefaultButton->SetName(_("Restore Defaults"));
|
||||
|
||||
S.AddStandardButtons(eOkButton | eCancelButton, mDefaultButton);
|
||||
S.EndVerticalLay();
|
||||
Layout();
|
||||
Fit();
|
||||
Center();
|
||||
|
||||
TransferDataFromWindow(); // set labels according to actual initial values
|
||||
|
||||
params.mStatus = p.mStatus = ShowModal();
|
||||
|
||||
if (p.mStatus == wxID_OK) {
|
||||
// Retain the settings
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/FramePeriod"), p.mFramePeriod);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/WindowSize"), p.mWindowSize);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/SilenceThreshold"),
|
||||
p.mSilenceThreshold);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/ForceFinalAlignment"),
|
||||
p.mForceFinalAlignment);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/IgnoreSilence"),
|
||||
p.mIgnoreSilence);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/PresmoothTime"),
|
||||
p.mPresmoothTime);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/LineTime"), p.mLineTime);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/SmoothTime"), p.mSmoothTime);
|
||||
gPrefs->Flush();
|
||||
|
||||
params = p; // return all parameters through params
|
||||
}
|
||||
}
|
||||
|
||||
ScoreAlignDialog::~ScoreAlignDialog()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//void ScoreAlignDialog::OnOK(wxCommandEvent & event)
|
||||
//{
|
||||
// EndModal(wxID_OK);
|
||||
//}
|
||||
|
||||
//void ScoreAlignDialog::OnCancel(wxCommandEvent & event)
|
||||
//{
|
||||
// EndModal(wxID_CANCEL);
|
||||
//}
|
||||
|
||||
void ScoreAlignDialog::OnSlider(wxCommandEvent & event)
|
||||
{
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
|
||||
void ScoreAlignDialog::OnDefault(wxCommandEvent & event)
|
||||
{
|
||||
mFramePeriodSlider->SetValue((int) (SA_DFT_FRAME_PERIOD * 100 + 0.5));
|
||||
mWindowSizeSlider->SetValue((int) (SA_DFT_WINDOW_SIZE * 100 + 0.5));
|
||||
mSilenceThresholdSlider->SetValue(
|
||||
(int) (SA_DFT_SILENCE_THRESHOLD * 1000 + 0.5));
|
||||
mForceFinalAlignmentCheckBox->SetValue(SA_DFT_FORCE_FINAL_ALIGNMENT);
|
||||
mIgnoreSilenceCheckBox->SetValue(SA_DFT_IGNORE_SILENCE);
|
||||
mPresmoothSlider->SetValue((int) (SA_DFT_PRESMOOTH_TIME * 100 + 0.5));
|
||||
mLineTimeSlider->SetValue((int) (SA_DFT_LINE_TIME * 100 + 0.5));
|
||||
mSmoothTimeSlider->SetValue((int) (SA_DFT_SMOOTH_TIME * 100 + 0.5));
|
||||
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
|
||||
bool ScoreAlignDialog::TransferDataFromWindow()
|
||||
{
|
||||
p.mFramePeriod = (double) mFramePeriodSlider->GetValue() / 100.0;
|
||||
p.mWindowSize = (double) mWindowSizeSlider->GetValue() / 100.0;
|
||||
p.mSilenceThreshold = (double) mSilenceThresholdSlider->GetValue() / 1000.0;
|
||||
p.mForceFinalAlignment = (double) mForceFinalAlignmentCheckBox->GetValue();
|
||||
p.mIgnoreSilence = (double) mIgnoreSilenceCheckBox->GetValue();
|
||||
p.mPresmoothTime = (double) mPresmoothSlider->GetValue() / 100.0;
|
||||
p.mLineTime = (double) mLineTimeSlider->GetValue() / 100.0;
|
||||
p.mSmoothTime = (double) mSmoothTimeSlider->GetValue() / 100.0;
|
||||
|
||||
mFramePeriodText->SetLabel(wxString::Format(_("%.2f secs"),
|
||||
p.mFramePeriod));
|
||||
mWindowSizeText->SetLabel(wxString::Format(_("%.2f secs"), p.mWindowSize));
|
||||
mSilenceThresholdText->SetLabel(wxString::Format(_("%.3f"),
|
||||
p.mSilenceThreshold));
|
||||
mPresmoothText->SetLabel(p.mPresmoothTime > 0 ?
|
||||
wxString::Format(_("%.2f secs"),
|
||||
p.mPresmoothTime) : wxT("(off)"));
|
||||
mLineTimeText->SetLabel(p.mLineTime > 0 ?
|
||||
wxString::Format(_("%.2f secs"), p.mLineTime) :
|
||||
wxT("(off)"));
|
||||
mSmoothTimeText->SetLabel(wxString::Format(_("%.2f secs"), p.mSmoothTime));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CloseScoreAlignDialog()
|
||||
{
|
||||
if (gScoreAlignDialog) {
|
||||
delete gScoreAlignDialog;
|
||||
gScoreAlignDialog = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(ScoreAlignDialog, wxDialog)
|
||||
// EVT_BUTTON(wxID_OK, ScoreAlignDialog::OnOK)
|
||||
// EVT_BUTTON(wxID_CANCEL, ScoreAlignDialog::OnCancel)
|
||||
EVT_BUTTON(ID_DEFAULT, ScoreAlignDialog::OnDefault)
|
||||
EVT_SLIDER(ID_FRAMEPERIOD, ScoreAlignDialog::OnSlider)
|
||||
EVT_SLIDER(ID_WINDOWSIZE, ScoreAlignDialog::OnSlider)
|
||||
EVT_SLIDER(ID_SILENCETHRESHOLD, ScoreAlignDialog::OnSlider)
|
||||
EVT_CHECKBOX(ID_FORCEFINALALIGNMENT, ScoreAlignDialog::OnSlider)
|
||||
EVT_CHECKBOX(ID_IGNORESILENCE, ScoreAlignDialog::OnSlider)
|
||||
EVT_SLIDER(ID_PRESMOOTH, ScoreAlignDialog::OnSlider)
|
||||
EVT_SLIDER(ID_LINETIME, ScoreAlignDialog::OnSlider)
|
||||
EVT_SLIDER(ID_SMOOTHTIME, ScoreAlignDialog::OnSlider)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#endif
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
Audacity(R) is copyright (c) 1999-2008 Audacity Team.
|
||||
License: GPL v2. See License.txt.
|
||||
|
||||
ScoreAlignDialog.cpp
|
||||
<TODO: authors>
|
||||
|
||||
******************************************************************//**
|
||||
|
||||
\class ScoreAlignDialog
|
||||
\brief ScoreAlignDialog is <TODO>.
|
||||
|
||||
It <TODO: description>
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
#include "../Audacity.h"
|
||||
#include "../Experimental.h"
|
||||
|
||||
#ifdef EXPERIMENTAL_SCOREALIGN
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/brush.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/dcmemory.h>
|
||||
#include <wx/msgdlg.h>
|
||||
#include <wx/file.h>
|
||||
#include <wx/filedlg.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/statusbr.h>
|
||||
#endif
|
||||
|
||||
#include <fstream>
|
||||
#include <wx/dialog.h>
|
||||
#include "../Prefs.h"
|
||||
#include "../ShuttleGui.h"
|
||||
#include "allegro.h"
|
||||
#include "audioreader.h"
|
||||
#include "scorealign.h"
|
||||
#include "scorealign-glue.h"
|
||||
#include "ScoreAlignDialog.h"
|
||||
|
||||
static ScoreAlignDialog *gScoreAlignDialog = NULL;
|
||||
|
||||
//IMPLEMENT_CLASS(ScoreAlignDialog, wxDialog)
|
||||
|
||||
ScoreAlignDialog::ScoreAlignDialog(wxWindow *parent, ScoreAlignParams ¶ms)
|
||||
: wxDialog(parent, -1, _("Align MIDI to Audio"),
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
wxDEFAULT_DIALOG_STYLE)
|
||||
{
|
||||
gScoreAlignDialog = this; // Allows anyone to close dialog by calling
|
||||
// CloseScoreAlignDialog()
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/FramePeriod"), &p.mFramePeriod,
|
||||
float(SA_DFT_FRAME_PERIOD));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/WindowSize"), &p.mWindowSize,
|
||||
float(SA_DFT_WINDOW_SIZE));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/SilenceThreshold"),
|
||||
&p.mSilenceThreshold, float(SA_DFT_SILENCE_THRESHOLD));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/ForceFinalAlignment"),
|
||||
&p.mForceFinalAlignment, float(SA_DFT_FORCE_FINAL_ALIGNMENT));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/IgnoreSilence"),
|
||||
&p.mIgnoreSilence, float(SA_DFT_IGNORE_SILENCE));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/PresmoothTime"), &p.mPresmoothTime,
|
||||
float(SA_DFT_PRESMOOTH_TIME));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/LineTime"), &p.mLineTime,
|
||||
float(SA_DFT_LINE_TIME));
|
||||
gPrefs->Read(wxT("/Tracks/Synchronize/SmoothTime"), &p.mSmoothTime,
|
||||
float(SA_DFT_SMOOTH_TIME));
|
||||
|
||||
//wxButton *ok = new wxButton(this, wxID_OK, _("OK"));
|
||||
//wxButton *cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
|
||||
//wxSlider *sl = new wxSlider(this, ID_SLIDER, 0, 0, 100,
|
||||
// wxDefaultPosition, wxSize(20, 124),
|
||||
// wxSL_HORIZONTAL);
|
||||
|
||||
ShuttleGui S(this, eIsCreating);
|
||||
//ok->SetDefault();
|
||||
|
||||
S.SetBorder(5);
|
||||
S.StartVerticalLay(true);
|
||||
S.StartStatic(wxT("Align MIDI to Audio"));
|
||||
S.StartMultiColumn(3, wxEXPAND | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStretchyCol(1);
|
||||
|
||||
mFramePeriodLabel = S.AddVariableText(_("Frame Period")+wxString(wxT(":")), true,
|
||||
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mFramePeriodSlider = S.Id(ID_FRAMEPERIOD).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mFramePeriod * 100 + 0.5), /*max*/ 50, /*min*/ 5);
|
||||
S.SetSizeHints(300, -1);
|
||||
mFramePeriodSlider->SetName(_("Frame Period"));
|
||||
mFramePeriodText = S.AddVariableText(SA_DFT_FRAME_PERIOD_TEXT, true,
|
||||
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
mWindowSizeLabel = S.AddVariableText(_("Window Size")+wxString(wxT(":")), true,
|
||||
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mWindowSizeSlider = S.Id(ID_WINDOWSIZE).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mWindowSize * 100 + 0.5), /*max*/ 100, /*min*/ 5);
|
||||
mWindowSizeSlider->SetName(_("Window Size"));
|
||||
mWindowSizeText = S.AddVariableText(SA_DFT_WINDOW_SIZE_TEXT, true,
|
||||
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
mForceFinalAlignmentCheckBox = S.Id(ID_FORCEFINALALIGNMENT).AddCheckBox(
|
||||
wxT("Force Final Alignment"),
|
||||
(p.mForceFinalAlignment ? wxT("true") : wxT("false")));
|
||||
mForceFinalAlignmentCheckBox->SetName(_("Force Final Alignment"));
|
||||
mIgnoreSilenceCheckBox = S.Id(ID_IGNORESILENCE).AddCheckBox(
|
||||
wxT("Ignore Silence at Beginnings and Endings"),
|
||||
(p.mIgnoreSilence ? wxT("true") : wxT("false")));
|
||||
mIgnoreSilenceCheckBox->SetName(
|
||||
_("Ignore Silence at Beginnings and Endings"));
|
||||
// need a third column after checkboxes:
|
||||
S.AddVariableText(wxT(""), true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
mSilenceThresholdLabel = S.AddVariableText(_("Silence Threshold:"),
|
||||
true, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mSilenceThresholdSlider = S.Id(ID_SILENCETHRESHOLD).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mSilenceThreshold * 1000 + 0.5), /*max*/ 500);
|
||||
mSilenceThresholdSlider->SetName(_("Silence Threshold"));
|
||||
mSilenceThresholdText = S.AddVariableText(SA_DFT_SILENCE_THRESHOLD_TEXT,
|
||||
true, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
/* i18n-hint: The English would be clearer if it had 'Duration' rather than 'Time'
|
||||
This is a new experimental effect, and until we have it documented in the user
|
||||
manual we don't have a clear description of what this parameter does.
|
||||
It is OK to leave it in English. */
|
||||
mPresmoothLabel = S.AddVariableText(_("Presmooth Time")+wxString(wxT(":")), true,
|
||||
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mPresmoothSlider = S.Id(ID_PRESMOOTH).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mPresmoothTime * 100 + 0.5), /*max*/ 500);
|
||||
mPresmoothSlider->SetName(_("Presmooth Time"));
|
||||
mPresmoothText = S.AddVariableText(SA_DFT_PRESMOOTH_TIME_TEXT, true,
|
||||
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
/* i18n-hint: The English would be clearer if it had 'Duration' rather than 'Time'
|
||||
This is a new experimental effect, and until we have it documented in the user
|
||||
manual we don't have a clear description of what this parameter does.
|
||||
It is OK to leave it in English. */
|
||||
mLineTimeLabel = S.AddVariableText(_("Line Time")+wxString(wxT(":")), true,
|
||||
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mLineTimeSlider = S.Id(ID_LINETIME).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mLineTime * 100 + 0.5), /*max*/ 500);
|
||||
mLineTimeSlider->SetName(_("Line Time"));
|
||||
mLineTimeText = S.AddVariableText(SA_DFT_LINE_TIME_TEXT, true,
|
||||
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
/* i18n-hint: The English would be clearer if it had 'Duration' rather than 'Time'
|
||||
This is a new experimental effect, and until we have it documented in the user
|
||||
manual we don't have a clear description of what this parameter does.
|
||||
It is OK to leave it in English. */
|
||||
mSmoothTimeLabel = S.AddVariableText(_("Smooth Time")+wxString(wxT(":")), true,
|
||||
wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL);
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
mSmoothTimeSlider = S.Id(ID_SMOOTHTIME).AddSlider(wxT(""),
|
||||
/*pos*/ (int) (p.mSmoothTime * 100 + 0.5), /*max*/ 500);
|
||||
mSmoothTimeSlider->SetName(_("Smooth Time"));
|
||||
mSmoothTimeText = S.AddVariableText(SA_DFT_SMOOTH_TIME_TEXT, true,
|
||||
wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL);
|
||||
|
||||
S.EndMultiColumn();
|
||||
S.EndStatic();
|
||||
|
||||
mDefaultButton = new wxButton(this, ID_DEFAULT, _("Use Defaults"));
|
||||
mDefaultButton->SetName(_("Restore Defaults"));
|
||||
|
||||
S.AddStandardButtons(eOkButton | eCancelButton, mDefaultButton);
|
||||
S.EndVerticalLay();
|
||||
Layout();
|
||||
Fit();
|
||||
Center();
|
||||
|
||||
TransferDataFromWindow(); // set labels according to actual initial values
|
||||
|
||||
params.mStatus = p.mStatus = ShowModal();
|
||||
|
||||
if (p.mStatus == wxID_OK) {
|
||||
// Retain the settings
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/FramePeriod"), p.mFramePeriod);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/WindowSize"), p.mWindowSize);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/SilenceThreshold"),
|
||||
p.mSilenceThreshold);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/ForceFinalAlignment"),
|
||||
p.mForceFinalAlignment);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/IgnoreSilence"),
|
||||
p.mIgnoreSilence);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/PresmoothTime"),
|
||||
p.mPresmoothTime);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/LineTime"), p.mLineTime);
|
||||
gPrefs->Write(wxT("/Tracks/Synchronize/SmoothTime"), p.mSmoothTime);
|
||||
gPrefs->Flush();
|
||||
|
||||
params = p; // return all parameters through params
|
||||
}
|
||||
}
|
||||
|
||||
ScoreAlignDialog::~ScoreAlignDialog()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//void ScoreAlignDialog::OnOK(wxCommandEvent & event)
|
||||
//{
|
||||
// EndModal(wxID_OK);
|
||||
//}
|
||||
|
||||
//void ScoreAlignDialog::OnCancel(wxCommandEvent & event)
|
||||
//{
|
||||
// EndModal(wxID_CANCEL);
|
||||
//}
|
||||
|
||||
void ScoreAlignDialog::OnSlider(wxCommandEvent & event)
|
||||
{
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
|
||||
void ScoreAlignDialog::OnDefault(wxCommandEvent & event)
|
||||
{
|
||||
mFramePeriodSlider->SetValue((int) (SA_DFT_FRAME_PERIOD * 100 + 0.5));
|
||||
mWindowSizeSlider->SetValue((int) (SA_DFT_WINDOW_SIZE * 100 + 0.5));
|
||||
mSilenceThresholdSlider->SetValue(
|
||||
(int) (SA_DFT_SILENCE_THRESHOLD * 1000 + 0.5));
|
||||
mForceFinalAlignmentCheckBox->SetValue(SA_DFT_FORCE_FINAL_ALIGNMENT);
|
||||
mIgnoreSilenceCheckBox->SetValue(SA_DFT_IGNORE_SILENCE);
|
||||
mPresmoothSlider->SetValue((int) (SA_DFT_PRESMOOTH_TIME * 100 + 0.5));
|
||||
mLineTimeSlider->SetValue((int) (SA_DFT_LINE_TIME * 100 + 0.5));
|
||||
mSmoothTimeSlider->SetValue((int) (SA_DFT_SMOOTH_TIME * 100 + 0.5));
|
||||
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
|
||||
bool ScoreAlignDialog::TransferDataFromWindow()
|
||||
{
|
||||
p.mFramePeriod = (double) mFramePeriodSlider->GetValue() / 100.0;
|
||||
p.mWindowSize = (double) mWindowSizeSlider->GetValue() / 100.0;
|
||||
p.mSilenceThreshold = (double) mSilenceThresholdSlider->GetValue() / 1000.0;
|
||||
p.mForceFinalAlignment = (double) mForceFinalAlignmentCheckBox->GetValue();
|
||||
p.mIgnoreSilence = (double) mIgnoreSilenceCheckBox->GetValue();
|
||||
p.mPresmoothTime = (double) mPresmoothSlider->GetValue() / 100.0;
|
||||
p.mLineTime = (double) mLineTimeSlider->GetValue() / 100.0;
|
||||
p.mSmoothTime = (double) mSmoothTimeSlider->GetValue() / 100.0;
|
||||
|
||||
mFramePeriodText->SetLabel(wxString::Format(_("%.2f secs"),
|
||||
p.mFramePeriod));
|
||||
mWindowSizeText->SetLabel(wxString::Format(_("%.2f secs"), p.mWindowSize));
|
||||
mSilenceThresholdText->SetLabel(wxString::Format(_("%.3f"),
|
||||
p.mSilenceThreshold));
|
||||
mPresmoothText->SetLabel(p.mPresmoothTime > 0 ?
|
||||
wxString::Format(_("%.2f secs"),
|
||||
p.mPresmoothTime) : wxT("(off)"));
|
||||
mLineTimeText->SetLabel(p.mLineTime > 0 ?
|
||||
wxString::Format(_("%.2f secs"), p.mLineTime) :
|
||||
wxT("(off)"));
|
||||
mSmoothTimeText->SetLabel(wxString::Format(_("%.2f secs"), p.mSmoothTime));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CloseScoreAlignDialog()
|
||||
{
|
||||
if (gScoreAlignDialog) {
|
||||
delete gScoreAlignDialog;
|
||||
gScoreAlignDialog = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(ScoreAlignDialog, wxDialog)
|
||||
// EVT_BUTTON(wxID_OK, ScoreAlignDialog::OnOK)
|
||||
// EVT_BUTTON(wxID_CANCEL, ScoreAlignDialog::OnCancel)
|
||||
EVT_BUTTON(ID_DEFAULT, ScoreAlignDialog::OnDefault)
|
||||
EVT_SLIDER(ID_FRAMEPERIOD, ScoreAlignDialog::OnSlider)
|
||||
EVT_SLIDER(ID_WINDOWSIZE, ScoreAlignDialog::OnSlider)
|
||||
EVT_SLIDER(ID_SILENCETHRESHOLD, ScoreAlignDialog::OnSlider)
|
||||
EVT_CHECKBOX(ID_FORCEFINALALIGNMENT, ScoreAlignDialog::OnSlider)
|
||||
EVT_CHECKBOX(ID_IGNORESILENCE, ScoreAlignDialog::OnSlider)
|
||||
EVT_SLIDER(ID_PRESMOOTH, ScoreAlignDialog::OnSlider)
|
||||
EVT_SLIDER(ID_LINETIME, ScoreAlignDialog::OnSlider)
|
||||
EVT_SLIDER(ID_SMOOTHTIME, ScoreAlignDialog::OnSlider)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,105 +1,105 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ScoreAlignDialog.h
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_SCORE_ALIGN_DIALOG__
|
||||
#define __AUDACITY_SCORE_ALIGN_DIALOG__
|
||||
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/slider.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include "ScoreAlignParams.h"
|
||||
|
||||
class wxButton;
|
||||
class wxSizer;
|
||||
class wxString;
|
||||
|
||||
void CloseScoreAlignDialog();
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ScoreAlignDialog
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// Declare window functions
|
||||
|
||||
class ScoreAlignDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
ScoreAlignParams p;
|
||||
|
||||
wxStaticText *mFramePeriodLabel;
|
||||
wxSlider *mFramePeriodSlider;
|
||||
wxStaticText *mFramePeriodText;
|
||||
|
||||
wxStaticText *mWindowSizeLabel;
|
||||
wxSlider *mWindowSizeSlider;
|
||||
wxStaticText *mWindowSizeText;
|
||||
|
||||
wxStaticText *mSilenceThresholdLabel;
|
||||
wxSlider *mSilenceThresholdSlider;
|
||||
wxStaticText *mSilenceThresholdText;
|
||||
|
||||
wxCheckBox *mForceFinalAlignmentCheckBox;
|
||||
wxCheckBox *mIgnoreSilenceCheckBox;
|
||||
|
||||
wxStaticText *mPresmoothLabel;
|
||||
wxSlider *mPresmoothSlider;
|
||||
wxStaticText *mPresmoothText;
|
||||
|
||||
wxStaticText *mLineTimeLabel;
|
||||
wxSlider *mLineTimeSlider;
|
||||
wxStaticText *mLineTimeText;
|
||||
|
||||
wxStaticText *mSmoothTimeLabel;
|
||||
wxSlider *mSmoothTimeSlider;
|
||||
wxStaticText *mSmoothTimeText;
|
||||
|
||||
wxButton *mDefaultButton;
|
||||
|
||||
// constructors and destructors
|
||||
ScoreAlignDialog(wxWindow * parent, ScoreAlignParams ¶ms);
|
||||
~ScoreAlignDialog();
|
||||
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
private:
|
||||
enum {
|
||||
ID_BASE = 10000,
|
||||
ID_PRESMOOTH,
|
||||
ID_WINDOWSIZE,
|
||||
ID_FRAMEPERIOD,
|
||||
ID_LINETIME,
|
||||
ID_SMOOTHTIME,
|
||||
ID_SILENCETHRESHOLD,
|
||||
ID_FORCEFINALALIGNMENT,
|
||||
ID_IGNORESILENCE,
|
||||
ID_DEFAULT
|
||||
};
|
||||
|
||||
// handlers
|
||||
void OnOK(wxCommandEvent & event);
|
||||
void OnCancel(wxCommandEvent & event);
|
||||
void OnSlider(wxCommandEvent & event);
|
||||
void OnDefault(wxCommandEvent & event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
|
||||
// version control system. Please do not modify past this point.
|
||||
//
|
||||
// Local Variables:
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
//
|
||||
// vim: et sts=3 sw=3
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ScoreAlignDialog.h
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_SCORE_ALIGN_DIALOG__
|
||||
#define __AUDACITY_SCORE_ALIGN_DIALOG__
|
||||
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/slider.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include "ScoreAlignParams.h"
|
||||
|
||||
class wxButton;
|
||||
class wxSizer;
|
||||
class wxString;
|
||||
|
||||
void CloseScoreAlignDialog();
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ScoreAlignDialog
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// Declare window functions
|
||||
|
||||
class ScoreAlignDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
ScoreAlignParams p;
|
||||
|
||||
wxStaticText *mFramePeriodLabel;
|
||||
wxSlider *mFramePeriodSlider;
|
||||
wxStaticText *mFramePeriodText;
|
||||
|
||||
wxStaticText *mWindowSizeLabel;
|
||||
wxSlider *mWindowSizeSlider;
|
||||
wxStaticText *mWindowSizeText;
|
||||
|
||||
wxStaticText *mSilenceThresholdLabel;
|
||||
wxSlider *mSilenceThresholdSlider;
|
||||
wxStaticText *mSilenceThresholdText;
|
||||
|
||||
wxCheckBox *mForceFinalAlignmentCheckBox;
|
||||
wxCheckBox *mIgnoreSilenceCheckBox;
|
||||
|
||||
wxStaticText *mPresmoothLabel;
|
||||
wxSlider *mPresmoothSlider;
|
||||
wxStaticText *mPresmoothText;
|
||||
|
||||
wxStaticText *mLineTimeLabel;
|
||||
wxSlider *mLineTimeSlider;
|
||||
wxStaticText *mLineTimeText;
|
||||
|
||||
wxStaticText *mSmoothTimeLabel;
|
||||
wxSlider *mSmoothTimeSlider;
|
||||
wxStaticText *mSmoothTimeText;
|
||||
|
||||
wxButton *mDefaultButton;
|
||||
|
||||
// constructors and destructors
|
||||
ScoreAlignDialog(wxWindow * parent, ScoreAlignParams ¶ms);
|
||||
~ScoreAlignDialog();
|
||||
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
private:
|
||||
enum {
|
||||
ID_BASE = 10000,
|
||||
ID_PRESMOOTH,
|
||||
ID_WINDOWSIZE,
|
||||
ID_FRAMEPERIOD,
|
||||
ID_LINETIME,
|
||||
ID_SMOOTHTIME,
|
||||
ID_SILENCETHRESHOLD,
|
||||
ID_FORCEFINALALIGNMENT,
|
||||
ID_IGNORESILENCE,
|
||||
ID_DEFAULT
|
||||
};
|
||||
|
||||
// handlers
|
||||
void OnOK(wxCommandEvent & event);
|
||||
void OnCancel(wxCommandEvent & event);
|
||||
void OnSlider(wxCommandEvent & event);
|
||||
void OnDefault(wxCommandEvent & event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
|
||||
// version control system. Please do not modify past this point.
|
||||
//
|
||||
// Local Variables:
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
//
|
||||
// vim: et sts=3 sw=3
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
Audacity(R) is copyright (c) 1999-2012 Audacity Team.
|
||||
License: GPL v2. See License.txt.
|
||||
|
||||
ODDecodeFFmpegTask.cpp
|
||||
Michael Chinen
|
||||
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
Audacity(R) is copyright (c) 1999-2012 Audacity Team.
|
||||
License: GPL v2. See License.txt.
|
||||
|
||||
ODDecodeFFmpegTask.cpp
|
||||
Michael Chinen
|
||||
|
||||
******************************************************************/
|
||||
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
Audacity(R) is copyright (c) 1999-2012 Audacity Team.
|
||||
License: GPL v2. See License.txt.
|
||||
|
||||
ODDecodeFFmpegTask.h
|
||||
Michael Chinen
|
||||
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
Audacity(R) is copyright (c) 1999-2012 Audacity Team.
|
||||
License: GPL v2. See License.txt.
|
||||
|
||||
ODDecodeFFmpegTask.h
|
||||
Michael Chinen
|
||||
|
||||
******************************************************************/
|
||||
|
||||
#include "../Experimental.h"
|
||||
|
||||
@@ -1,110 +1,110 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ExtImportPrefs.h
|
||||
|
||||
LRN
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_EXT_IMPORT_PREFS__
|
||||
#define __AUDACITY_EXT_IMPORT_PREFS__
|
||||
|
||||
#include <wx/defs.h>
|
||||
#include <wx/dnd.h>
|
||||
#include <wx/window.h>
|
||||
#include "../widgets/Grid.h"
|
||||
|
||||
#include "../ShuttleGui.h"
|
||||
|
||||
#include "PrefsPanel.h"
|
||||
|
||||
#include "../import/Import.h"
|
||||
#include "../import/ImportPlugin.h"
|
||||
|
||||
class wxListEvent;
|
||||
class ExtImportPrefs;
|
||||
|
||||
class ExtImportPrefsDropTarget: public wxDropTarget
|
||||
{
|
||||
public:
|
||||
ExtImportPrefsDropTarget (wxDataObject *dataObject = 0);
|
||||
~ExtImportPrefsDropTarget ();
|
||||
wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
|
||||
bool OnDrop(wxCoord x, wxCoord y);
|
||||
wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def);
|
||||
wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
||||
void OnLeave();
|
||||
void SetDataObject(wxDataObject* data);
|
||||
void SetPrefs (ExtImportPrefs *prefs);
|
||||
private:
|
||||
ExtImportPrefs *mPrefs;
|
||||
};
|
||||
|
||||
class ExtImportPrefs:public PrefsPanel
|
||||
{
|
||||
public:
|
||||
ExtImportPrefs(wxWindow * parent);
|
||||
~ExtImportPrefs();
|
||||
virtual bool Apply();
|
||||
|
||||
void OnPluginKeyDown(wxListEvent& event);
|
||||
void OnPluginBeginDrag(wxListEvent& event);
|
||||
void OnRuleTableKeyDown(wxKeyEvent& event);
|
||||
void OnRuleTableSelect(wxGridEvent& event);
|
||||
void OnRuleTableEdit(wxGridEvent& event);
|
||||
void OnRuleTableSelectRange(wxGridRangeSelectEvent& event);
|
||||
void OnRuleTableCellClick(wxGridEvent& event);
|
||||
void OnAddRule(wxCommandEvent& event);
|
||||
void OnDelRule(wxCommandEvent& event);
|
||||
void OnRuleMoveUp(wxCommandEvent& event);
|
||||
void OnRuleMoveDown(wxCommandEvent& event);
|
||||
void OnFilterMoveUp(wxCommandEvent& event);
|
||||
void OnFilterMoveDown(wxCommandEvent& event);
|
||||
|
||||
void OnNavKey (wxNavigationKeyEvent& event);
|
||||
|
||||
void SwapRows (int row1, int row2);
|
||||
void SwapPluginRows (int row1, int row2);
|
||||
|
||||
Grid *GetRuleTable() { return RuleTable; }
|
||||
wxListCtrl *GetPluginList() { return PluginList; }
|
||||
|
||||
wxWindow *GetDragFocus() { return mDragFocus; }
|
||||
|
||||
private:
|
||||
|
||||
Grid *RuleTable;
|
||||
wxListCtrl *PluginList;
|
||||
|
||||
wxButton *AddRule;
|
||||
wxButton *DelRule;
|
||||
wxButton *MoveRuleUp;
|
||||
wxButton *MoveRuleDown;
|
||||
wxButton *MoveFilterUp;
|
||||
wxButton *MoveFilterDown;
|
||||
|
||||
wxTextDataObject *dragtext1;
|
||||
wxTextDataObject *dragtext2;
|
||||
ExtImportPrefsDropTarget *dragtarget1;
|
||||
ExtImportPrefsDropTarget *dragtarget2;
|
||||
|
||||
bool mCreateTable;
|
||||
wxWindow *mDragFocus;
|
||||
bool mFakeKeyEvent;
|
||||
bool mStopRecursiveSelection;
|
||||
|
||||
int last_selected;
|
||||
|
||||
void FakeOnPluginKeyDown (int keycode);
|
||||
void DoOnRuleTableKeyDown (int keycode);
|
||||
bool DoOnPluginKeyDown (int code);
|
||||
void DoOnRuleTableSelect (int toprow);
|
||||
void AddItemToTable (int index, ExtImportItem *item);
|
||||
void Populate();
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ExtImportPrefs.h
|
||||
|
||||
LRN
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_EXT_IMPORT_PREFS__
|
||||
#define __AUDACITY_EXT_IMPORT_PREFS__
|
||||
|
||||
#include <wx/defs.h>
|
||||
#include <wx/dnd.h>
|
||||
#include <wx/window.h>
|
||||
#include "../widgets/Grid.h"
|
||||
|
||||
#include "../ShuttleGui.h"
|
||||
|
||||
#include "PrefsPanel.h"
|
||||
|
||||
#include "../import/Import.h"
|
||||
#include "../import/ImportPlugin.h"
|
||||
|
||||
class wxListEvent;
|
||||
class ExtImportPrefs;
|
||||
|
||||
class ExtImportPrefsDropTarget: public wxDropTarget
|
||||
{
|
||||
public:
|
||||
ExtImportPrefsDropTarget (wxDataObject *dataObject = 0);
|
||||
~ExtImportPrefsDropTarget ();
|
||||
wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def);
|
||||
bool OnDrop(wxCoord x, wxCoord y);
|
||||
wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def);
|
||||
wxDragResult OnDragOver(wxCoord x, wxCoord y, wxDragResult def);
|
||||
void OnLeave();
|
||||
void SetDataObject(wxDataObject* data);
|
||||
void SetPrefs (ExtImportPrefs *prefs);
|
||||
private:
|
||||
ExtImportPrefs *mPrefs;
|
||||
};
|
||||
|
||||
class ExtImportPrefs:public PrefsPanel
|
||||
{
|
||||
public:
|
||||
ExtImportPrefs(wxWindow * parent);
|
||||
~ExtImportPrefs();
|
||||
virtual bool Apply();
|
||||
|
||||
void OnPluginKeyDown(wxListEvent& event);
|
||||
void OnPluginBeginDrag(wxListEvent& event);
|
||||
void OnRuleTableKeyDown(wxKeyEvent& event);
|
||||
void OnRuleTableSelect(wxGridEvent& event);
|
||||
void OnRuleTableEdit(wxGridEvent& event);
|
||||
void OnRuleTableSelectRange(wxGridRangeSelectEvent& event);
|
||||
void OnRuleTableCellClick(wxGridEvent& event);
|
||||
void OnAddRule(wxCommandEvent& event);
|
||||
void OnDelRule(wxCommandEvent& event);
|
||||
void OnRuleMoveUp(wxCommandEvent& event);
|
||||
void OnRuleMoveDown(wxCommandEvent& event);
|
||||
void OnFilterMoveUp(wxCommandEvent& event);
|
||||
void OnFilterMoveDown(wxCommandEvent& event);
|
||||
|
||||
void OnNavKey (wxNavigationKeyEvent& event);
|
||||
|
||||
void SwapRows (int row1, int row2);
|
||||
void SwapPluginRows (int row1, int row2);
|
||||
|
||||
Grid *GetRuleTable() { return RuleTable; }
|
||||
wxListCtrl *GetPluginList() { return PluginList; }
|
||||
|
||||
wxWindow *GetDragFocus() { return mDragFocus; }
|
||||
|
||||
private:
|
||||
|
||||
Grid *RuleTable;
|
||||
wxListCtrl *PluginList;
|
||||
|
||||
wxButton *AddRule;
|
||||
wxButton *DelRule;
|
||||
wxButton *MoveRuleUp;
|
||||
wxButton *MoveRuleDown;
|
||||
wxButton *MoveFilterUp;
|
||||
wxButton *MoveFilterDown;
|
||||
|
||||
wxTextDataObject *dragtext1;
|
||||
wxTextDataObject *dragtext2;
|
||||
ExtImportPrefsDropTarget *dragtarget1;
|
||||
ExtImportPrefsDropTarget *dragtarget2;
|
||||
|
||||
bool mCreateTable;
|
||||
wxWindow *mDragFocus;
|
||||
bool mFakeKeyEvent;
|
||||
bool mStopRecursiveSelection;
|
||||
|
||||
int last_selected;
|
||||
|
||||
void FakeOnPluginKeyDown (int keycode);
|
||||
void DoOnRuleTableKeyDown (int keycode);
|
||||
bool DoOnPluginKeyDown (int code);
|
||||
void DoOnRuleTableSelect (int toprow);
|
||||
void AddItemToTable (int index, ExtImportItem *item);
|
||||
void Populate();
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,89 +1,89 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ModulePrefs.cpp
|
||||
|
||||
Brian Gunlogson
|
||||
Joshua Haberman
|
||||
Dominic Mazzoni
|
||||
James Crook
|
||||
|
||||
|
||||
*******************************************************************//**
|
||||
|
||||
\class ModulePrefs
|
||||
\brief A PrefsPanel to enable/disable certain modules.
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
#include "../Audacity.h"
|
||||
|
||||
#include <wx/defs.h>
|
||||
|
||||
#include "../ShuttleGui.h"
|
||||
|
||||
#include "ModulePrefs.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ModulePrefs::ModulePrefs(wxWindow * parent)
|
||||
: PrefsPanel(parent, _("Modules"))
|
||||
{
|
||||
Populate();
|
||||
}
|
||||
|
||||
ModulePrefs::~ModulePrefs()
|
||||
{
|
||||
}
|
||||
|
||||
void ModulePrefs::Populate()
|
||||
{
|
||||
//------------------------- Main section --------------------
|
||||
// Now construct the GUI itself.
|
||||
// Use 'eIsCreatingFromPrefs' so that the GUI is
|
||||
// initialised with values from gPrefs.
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
// ----------------------- End of main section --------------
|
||||
}
|
||||
|
||||
void ModulePrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
{
|
||||
S.SetBorder(2);
|
||||
|
||||
S.StartStatic(_("Enable these Modules (if present), next time Audacity is started"));
|
||||
{
|
||||
S.AddFixedText(_("These are experimental. Enable them only if you've read the manual\nand know what you are doing.") );
|
||||
S.TieCheckBox(_("mod-&script-pipe"),
|
||||
wxT("/Module/mod-script-pipe"),
|
||||
false);
|
||||
S.TieCheckBox(_("mod-&nyq-bench"),
|
||||
wxT("/Module/mod-nyq-bench"),
|
||||
false);
|
||||
S.TieCheckBox(_("mod-&track-panel"),
|
||||
wxT("/Module/mod-track-panel"),
|
||||
false);
|
||||
}
|
||||
S.EndStatic();
|
||||
}
|
||||
|
||||
bool ModulePrefs::Apply()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
|
||||
// version control system. Please do not modify past this point.
|
||||
//
|
||||
// Local Variables:
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
//
|
||||
// vim: et sts=3 sw=3
|
||||
// arch-tag: 7e997d04-6b94-4abb-b3d6-748400f86598
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ModulePrefs.cpp
|
||||
|
||||
Brian Gunlogson
|
||||
Joshua Haberman
|
||||
Dominic Mazzoni
|
||||
James Crook
|
||||
|
||||
|
||||
*******************************************************************//**
|
||||
|
||||
\class ModulePrefs
|
||||
\brief A PrefsPanel to enable/disable certain modules.
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
#include "../Audacity.h"
|
||||
|
||||
#include <wx/defs.h>
|
||||
|
||||
#include "../ShuttleGui.h"
|
||||
|
||||
#include "ModulePrefs.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
ModulePrefs::ModulePrefs(wxWindow * parent)
|
||||
: PrefsPanel(parent, _("Modules"))
|
||||
{
|
||||
Populate();
|
||||
}
|
||||
|
||||
ModulePrefs::~ModulePrefs()
|
||||
{
|
||||
}
|
||||
|
||||
void ModulePrefs::Populate()
|
||||
{
|
||||
//------------------------- Main section --------------------
|
||||
// Now construct the GUI itself.
|
||||
// Use 'eIsCreatingFromPrefs' so that the GUI is
|
||||
// initialised with values from gPrefs.
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
// ----------------------- End of main section --------------
|
||||
}
|
||||
|
||||
void ModulePrefs::PopulateOrExchange(ShuttleGui & S)
|
||||
{
|
||||
S.SetBorder(2);
|
||||
|
||||
S.StartStatic(_("Enable these Modules (if present), next time Audacity is started"));
|
||||
{
|
||||
S.AddFixedText(_("These are experimental. Enable them only if you've read the manual\nand know what you are doing.") );
|
||||
S.TieCheckBox(_("mod-&script-pipe"),
|
||||
wxT("/Module/mod-script-pipe"),
|
||||
false);
|
||||
S.TieCheckBox(_("mod-&nyq-bench"),
|
||||
wxT("/Module/mod-nyq-bench"),
|
||||
false);
|
||||
S.TieCheckBox(_("mod-&track-panel"),
|
||||
wxT("/Module/mod-track-panel"),
|
||||
false);
|
||||
}
|
||||
S.EndStatic();
|
||||
}
|
||||
|
||||
bool ModulePrefs::Apply()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
|
||||
// version control system. Please do not modify past this point.
|
||||
//
|
||||
// Local Variables:
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
//
|
||||
// vim: et sts=3 sw=3
|
||||
// arch-tag: 7e997d04-6b94-4abb-b3d6-748400f86598
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ModulePrefs.h
|
||||
|
||||
Brian Gunlogson
|
||||
Joshua Haberman
|
||||
James Crook
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_MODULE_PREFS__
|
||||
#define __AUDACITY_MODULE_PREFS__
|
||||
|
||||
#include <wx/defs.h>
|
||||
|
||||
#include <wx/window.h>
|
||||
|
||||
#include "../ShuttleGui.h"
|
||||
|
||||
#include "PrefsPanel.h"
|
||||
|
||||
class ModulePrefs:public PrefsPanel
|
||||
{
|
||||
public:
|
||||
ModulePrefs(wxWindow * parent);
|
||||
~ModulePrefs();
|
||||
virtual bool Apply();
|
||||
|
||||
private:
|
||||
void Populate();
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
|
||||
// version control system. Please do not modify past this point.
|
||||
//
|
||||
// Local Variables:
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
//
|
||||
// vim: et sts=3 sw=3
|
||||
// arch-tag: 57018e2b-d264-4f93-bfa7-06752ebf631e
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ModulePrefs.h
|
||||
|
||||
Brian Gunlogson
|
||||
Joshua Haberman
|
||||
James Crook
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_MODULE_PREFS__
|
||||
#define __AUDACITY_MODULE_PREFS__
|
||||
|
||||
#include <wx/defs.h>
|
||||
|
||||
#include <wx/window.h>
|
||||
|
||||
#include "../ShuttleGui.h"
|
||||
|
||||
#include "PrefsPanel.h"
|
||||
|
||||
class ModulePrefs:public PrefsPanel
|
||||
{
|
||||
public:
|
||||
ModulePrefs(wxWindow * parent);
|
||||
~ModulePrefs();
|
||||
virtual bool Apply();
|
||||
|
||||
private:
|
||||
void Populate();
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// Indentation settings for Vim and Emacs and unique identifier for Arch, a
|
||||
// version control system. Please do not modify past this point.
|
||||
//
|
||||
// Local Variables:
|
||||
// c-basic-offset: 3
|
||||
// indent-tabs-mode: nil
|
||||
// End:
|
||||
//
|
||||
// vim: et sts=3 sw=3
|
||||
// arch-tag: 57018e2b-d264-4f93-bfa7-06752ebf631e
|
||||
|
||||
Reference in New Issue
Block a user