Added a "toggle next line on commit" button to the audio tool bar

Originally committed to SVN as r1230.
This commit is contained in:
Rodrigo Braz Monteiro 2007-06-17 02:34:27 +00:00
parent 9bb7b61007
commit 063bf22a42
7 changed files with 25 additions and 8 deletions

View file

@ -172,18 +172,22 @@ wxPanel(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL|wxBORDER_RAISE
AutoCommit->SetToolTip(_("Automatically commit all changes"));
AutoCommit->SetValue(Options.AsBool(_T("Audio Autocommit")));
ButtonSizer->Add(AutoCommit,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0);
NextCommit = new ToggleBitmap(this,Audio_Check_NextCommit,wxBITMAP(toggle_audio_nextcommit),wxSize(30,-1));
NextCommit->SetToolTip(_("Auto goes to next line on commit"));
NextCommit->SetValue(Options.AsBool(_T("Audio Next Line on Commit")));
ButtonSizer->Add(NextCommit,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0);
AutoScroll = new ToggleBitmap(this,Audio_Check_AutoGoto,wxBITMAP(toggle_audio_autoscroll),wxSize(30,-1));
AutoScroll->SetToolTip(_("Auto scrolls audio display to selected line"));
AutoScroll->SetValue(Options.AsBool(_T("Audio Autoscroll")));
ButtonSizer->Add(AutoScroll,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0);
MedusaMode = new ToggleBitmap(this,Audio_Check_Medusa,wxBITMAP(toggle_audio_medusa),wxSize(30,-1));
MedusaMode->SetToolTip(_("Enable Medusa-Style Timing Shortcuts"));
MedusaMode->SetValue(Options.AsBool(_T("Audio Medusa Timing Hotkeys")));
ButtonSizer->Add(MedusaMode,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0);
SpectrumMode = new ToggleBitmap(this,Audio_Check_Spectrum,wxBITMAP(toggle_audio_spectrum),wxSize(30,-1));
SpectrumMode->SetToolTip(_("Spectrum analyzer mode"));
SpectrumMode->SetValue(Options.AsBool(_T("Audio Spectrum")));
ButtonSizer->Add(SpectrumMode,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0);
MedusaMode = new ToggleBitmap(this,Audio_Check_Medusa,wxBITMAP(toggle_audio_medusa),wxSize(30,-1));
MedusaMode->SetToolTip(_("Enable Medusa-Style Timing Shortcuts"));
MedusaMode->SetValue(Options.AsBool(_T("Audio Medusa Timing Hotkeys")));
ButtonSizer->Add(MedusaMode,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0);
ButtonSizer->AddStretchSpacer(1);
// Karaoke sizer
@ -281,6 +285,7 @@ BEGIN_EVENT_TABLE(AudioBox,wxPanel)
EVT_TOGGLEBUTTON(Audio_Check_Medusa,AudioBox::OnMedusaMode)
EVT_TOGGLEBUTTON(Audio_Check_Spectrum,AudioBox::OnSpectrumMode)
EVT_TOGGLEBUTTON(Audio_Check_AutoCommit,AudioBox::OnAutoCommit)
EVT_TOGGLEBUTTON(Audio_Check_NextCommit,AudioBox::OnNextLineCommit)
END_EVENT_TABLE()
@ -584,6 +589,15 @@ void AudioBox::OnAutoCommit(wxCommandEvent &event) {
}
//////////////////////
// Next line on Commit
void AudioBox::OnNextLineCommit(wxCommandEvent &event) {
audioDisplay->SetFocus();
Options.SetBool(_T("Audio Next Line on Commit"),NextCommit->GetValue());
Options.Save();
}
///////////////
// Medusa Mode
void AudioBox::OnMedusaMode(wxCommandEvent &event) {

View file

@ -73,6 +73,7 @@ private:
wxToggleButton *SplitButton;
wxButton *JoinButton;
ToggleBitmap *AutoScroll;
ToggleBitmap *NextCommit;
ToggleBitmap *MedusaMode;
ToggleBitmap *AutoCommit;
ToggleBitmap *SpectrumMode;
@ -106,6 +107,7 @@ private:
void OnAutoCommit(wxCommandEvent &event);
void OnMedusaMode(wxCommandEvent &event);
void OnSpectrumMode(wxCommandEvent &event);
void OnNextLineCommit(wxCommandEvent &event);
public:
AudioDisplay *audioDisplay;
@ -163,6 +165,7 @@ enum {
Audio_Button_Leadout,
Audio_Check_AutoCommit,
Audio_Check_NextCommit,
Audio_Check_AutoGoto,
Audio_Check_Medusa,
Audio_Check_Spectrum

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -431,11 +431,10 @@ DialogOptions::DialogOptions(wxWindow *parent)
// Sizers
wxSizer *audioMainSizer = new wxBoxSizer(wxVERTICAL);
wxSizer *audioSizer1 = new wxStaticBoxSizer(wxVERTICAL,audioPage,_("Options"));
wxFlexGridSizer *audioSizer3 = new wxFlexGridSizer(4,2,5,5);
wxFlexGridSizer *audioSizer3 = new wxFlexGridSizer(3,2,5,5);
wxFlexGridSizer *audioSizer4 = new wxFlexGridSizer(4,2,5,5);
// First sizer
AddCheckBox(audioPage,audioSizer3,_("Next line on commit"),_T("Audio Next Line on Commit"));
AddCheckBox(audioPage,audioSizer3,_("Grab times from line upon selection"),_T("Audio grab times on select"));
AddCheckBox(audioPage,audioSizer3,_("Default mouse wheel to zoom"),_T("Audio Wheel Default To Zoom"));
AddCheckBox(audioPage,audioSizer3,_("Lock scroll on Cursor"),_T("Audio lock scroll on cursor"));

View file

@ -157,7 +157,6 @@ void OptionsManager::LoadDefaults(bool onlyDefaults) {
// Audio Options
SetModificationType(MOD_AUTOMATIC);
SetBool(_T("Audio Next Line on Commit"),true);
SetBool(_T("Audio grab times on select"),true);
SetBool(_T("Audio Autofocus"),false);
SetBool(_T("Audio Wheel Default To Zoom"),false);
@ -290,6 +289,7 @@ void OptionsManager::LoadDefaults(bool onlyDefaults) {
SetBool(_T("Audio Autocommit"),false);
SetBool(_T("Audio Autoscroll"),true);
SetBool(_T("Audio Medusa Timing Hotkeys"),false);
SetBool(_T("Audio Next Line on Commit"),true);
SetBool(_T("Shift Times ByTime"),true);
SetInt(_T("Shift Times Type"),0);

View file

@ -121,6 +121,7 @@ button_leadout BITMAP "bitmaps/button_leadout.bmp"
toggle_audio_autoscroll BITMAP "bitmaps/toggle_audio_autoscroll.bmp"
toggle_audio_autocommit BITMAP "bitmaps/toggle_audio_autocommit.bmp"
toggle_audio_nextcommit BITMAP "bitmaps/toggle_audio_nextcommit.bmp"
toggle_audio_ssa BITMAP "bitmaps/toggle_audio_ssa.bmp"
toggle_audio_medusa BITMAP "bitmaps/toggle_audio_medusa.bmp"
toggle_audio_spectrum BITMAP "bitmaps/toggle_audio_spectrum.bmp"

View file

@ -232,7 +232,7 @@ void SRTSubtitleFormat::DialogueToSRT(AssDialogue *current,std::list<AssEntry*>:
// Fix line breaks
current->Text.Replace(_T("\\n"),_T("\r\n"),true);
current->Text.Replace(_T("\\N"),_T("\r\n"),true);
current->Text.Replace(_T("\r\n\r\n"),_T("\r\n"),true);
while (current->Text.Replace(_T("\r\n\r\n"),_T("\r\n"),true));
}