Added Medusa-style (numpad) global timing shortcuts, that can be enabled with the button under the audio display. This is disabled by default.

Originally committed to SVN as r662.
This commit is contained in:
Rodrigo Braz Monteiro 2006-12-30 22:08:23 +00:00
parent 23e73cb505
commit 280b9acf61
7 changed files with 106 additions and 11 deletions

View File

@ -238,6 +238,8 @@ void AudioBox::SetFile(wxString file,bool FromVideo) {
if (file != _T("")) loaded = audioDisplay->loaded;
audioName = file;
}
frameMain->SetAccelerators();
}
@ -271,6 +273,7 @@ BEGIN_EVENT_TABLE(AudioBox,wxPanel)
EVT_TOGGLEBUTTON(Audio_Check_AutoGoto,AudioBox::OnAutoGoto)
EVT_TOGGLEBUTTON(Audio_Button_Split,AudioBox::OnSplit)
EVT_TOGGLEBUTTON(Audio_Check_SSA,AudioBox::OnSSAMode)
EVT_TOGGLEBUTTON(Audio_Check_Medusa,AudioBox::OnMedusaMode)
EVT_TOGGLEBUTTON(Audio_Check_Spectrum,AudioBox::OnSpectrumMode)
EVT_TOGGLEBUTTON(Audio_Check_AutoCommit,AudioBox::OnAutoCommit)
END_EVENT_TABLE()
@ -590,6 +593,16 @@ void AudioBox::OnSSAMode(wxCommandEvent &event) {
}
///////////////
// Medusa Mode
void AudioBox::OnMedusaMode(wxCommandEvent &event) {
audioDisplay->SetFocus();
Options.SetBool(_T("Audio Medusa Timing Hotkeys"),MedusaMode->GetValue());
Options.Save();
frameMain->SetAccelerators();
}
//////////////////////////
// Spectrum Analyzer Mode
void AudioBox::OnSpectrumMode(wxCommandEvent &event) {

View File

@ -107,6 +107,7 @@ private:
void OnAutoGoto(wxCommandEvent &event);
void OnAutoCommit(wxCommandEvent &event);
void OnSSAMode(wxCommandEvent &event);
void OnMedusaMode(wxCommandEvent &event);
void OnSpectrumMode(wxCommandEvent &event);
public:

View File

@ -54,11 +54,13 @@ class AudioBox;
class AudioKaraoke;
class VideoDisplay;
class VideoProvider;
class FrameMain;
/////////////////
// Display class
class AudioDisplay: public wxWindow {
friend class FrameMain;
private:
SubtitlesGrid *grid;
int line_n;

View File

@ -61,6 +61,7 @@ Please visit http://aegisub.net to download latest version
- Minor fix to the calculation of the grid's "Style" column width. (AMZ)
- Added a "Selection Onward" option to the Shift Times dialogue. (AMZ)
- Main menu was completely re-designed, including several new options. (AMZ)
- Added Medusa-style (numpad) global timing shortcuts, that can be enabled with the button under the audio display. This is disabled by default. (AMZ)
= 1.10 beta - 2006.08.07 ===========================

View File

@ -59,6 +59,7 @@
#include "dialog_splash.h"
#include "dialog_tip.h"
#include "audio_box.h"
#include "audio_display.h"
#include "video_box.h"
#include "drop.h"
#include "hotkeys.h"
@ -1246,8 +1247,10 @@ void FrameMain::StatusTimeout(wxString text,int ms) {
///////////////////////////
// Setup accelerator table
void FrameMain::SetAccelerators() {
wxAcceleratorEntry entry[11];
wxAcceleratorEntry entry[20];
int i = 0;
// Standard
entry[i++] = Hotkeys.GetAccelerator(_T("Video global prev frame"),Video_Prev_Frame);
entry[i++] = Hotkeys.GetAccelerator(_T("Video global next frame"),Video_Next_Frame);
entry[i++] = Hotkeys.GetAccelerator(_T("Video global focus seek"),Video_Focus_Seek);
@ -1258,9 +1261,23 @@ void FrameMain::SetAccelerators() {
entry[i++] = Hotkeys.GetAccelerator(_T("Video global zoom out"),Menu_Video_Zoom_Out);
entry[i++] = Hotkeys.GetAccelerator(_T("Video global play"),Video_Play);
entry[i++] = Hotkeys.GetAccelerator(_T("Edit box commit"),Edit_Box_Commit);
wxAcceleratorEntry temp;
temp.Set(wxACCEL_CTRL | wxACCEL_ALT,WXK_F12,Kana_Game);
entry[i++] = temp;
// Medusa
bool medusaPlay = Options.AsBool(_T("Audio Medusa Timing Hotkeys"));
if (medusaPlay && audioBox->audioDisplay->loaded) {
entry[i++] = Hotkeys.GetAccelerator(_T("Audio Medusa Play"),Medusa_Play);
entry[i++] = Hotkeys.GetAccelerator(_T("Audio Medusa Stop"),Medusa_Stop);
entry[i++] = Hotkeys.GetAccelerator(_T("Audio Medusa Play Before"),Medusa_Play_Before);
entry[i++] = Hotkeys.GetAccelerator(_T("Audio Medusa Play After"),Medusa_Play_After);
entry[i++] = Hotkeys.GetAccelerator(_T("Audio Medusa Next"),Medusa_Next);
entry[i++] = Hotkeys.GetAccelerator(_T("Audio Medusa Previous"),Medusa_Prev);
entry[i++] = Hotkeys.GetAccelerator(_T("Audio Medusa Shift Start Forward"),Medusa_Shift_Start_Forward);
entry[i++] = Hotkeys.GetAccelerator(_T("Audio Medusa Shift Start Back"),Medusa_Shift_Start_Back);
entry[i++] = Hotkeys.GetAccelerator(_T("Audio Medusa Shift End Forward"),Medusa_Shift_End_Forward);
entry[i++] = Hotkeys.GetAccelerator(_T("Audio Medusa Shift End Back"),Medusa_Shift_End_Back);
}
// Set table
wxAcceleratorTable table(i,entry);
SetAcceleratorTable(table);
}

View File

@ -229,7 +229,14 @@ private:
void OnPrevLine(wxCommandEvent &event);
void OnToggleTags(wxCommandEvent &event);
void OnKanaGame(wxCommandEvent &event);
void OnMedusaPlay(wxCommandEvent &event);
void OnMedusaStop(wxCommandEvent &event);
void OnMedusaShiftStartForward(wxCommandEvent &event);
void OnMedusaShiftStartBack(wxCommandEvent &event);
void OnMedusaShiftEndForward(wxCommandEvent &event);
void OnMedusaShiftEndBack(wxCommandEvent &event);
void OnMedusaPlayBefore(wxCommandEvent &event);
void OnMedusaPlayAfter(wxCommandEvent &event);
void LoadVideo(wxString filename,bool autoload=false);
void LoadAudio(wxString filename,bool FromVideo=false);
@ -407,7 +414,16 @@ enum {
Video_Track_Link_File,
Video_Track_Movement_Empty,
Kana_Game,
Medusa_Play,
Medusa_Stop,
Medusa_Shift_Start_Forward,
Medusa_Shift_Start_Back,
Medusa_Shift_End_Forward,
Medusa_Shift_End_Back,
Medusa_Play_Before,
Medusa_Play_After,
Medusa_Next,
Medusa_Prev,
Menu_File_Recent = 2000,
Menu_Video_Recent = 2200,

View File

@ -214,7 +214,16 @@ BEGIN_EVENT_TABLE(FrameMain, wxFrame)
EVT_MENU(Grid_Toggle_Tags,FrameMain::OnToggleTags)
EVT_MENU(Edit_Box_Commit,FrameMain::OnEditBoxCommit)
EVT_MENU(Kana_Game, FrameMain::OnKanaGame)
EVT_MENU(Medusa_Play, FrameMain::OnMedusaPlay)
EVT_MENU(Medusa_Stop, FrameMain::OnMedusaStop)
EVT_MENU(Medusa_Play_After, FrameMain::OnMedusaPlayAfter)
EVT_MENU(Medusa_Play_Before, FrameMain::OnMedusaPlayBefore)
EVT_MENU(Medusa_Next, FrameMain::OnNextLine)
EVT_MENU(Medusa_Prev, FrameMain::OnPrevLine)
EVT_MENU(Medusa_Shift_Start_Forward, FrameMain::OnMedusaShiftStartForward)
EVT_MENU(Medusa_Shift_Start_Back, FrameMain::OnMedusaShiftStartBack)
EVT_MENU(Medusa_Shift_End_Forward, FrameMain::OnMedusaShiftEndForward)
EVT_MENU(Medusa_Shift_End_Back, FrameMain::OnMedusaShiftEndBack)
#ifdef __WXMAC__
EVT_MENU(wxID_ABOUT, FrameMain::OnAbout)
@ -1592,8 +1601,44 @@ void FrameMain::OnViewSubs (wxCommandEvent &event) {
}
/////////////
// Kana game
void FrameMain::OnKanaGame(wxCommandEvent &event) {
wxMessageBox(_T("TODO"));
////////////////////
// Medusa shortcuts
void FrameMain::OnMedusaPlay(wxCommandEvent &event) {
int start=0,end=0;
audioBox->audioDisplay->GetTimesSelection(start,end);
audioBox->audioDisplay->Play(start,end);
}
void FrameMain::OnMedusaStop(wxCommandEvent &event) {
audioBox->audioDisplay->Stop();
audioBox->audioDisplay->Refresh();
}
void FrameMain::OnMedusaShiftStartForward(wxCommandEvent &event) {
audioBox->audioDisplay->curStartMS += 10;
audioBox->audioDisplay->Update();
audioBox->audioDisplay->wxWindow::Update();
}
void FrameMain::OnMedusaShiftStartBack(wxCommandEvent &event) {
audioBox->audioDisplay->curStartMS -= 10;
audioBox->audioDisplay->Update();
audioBox->audioDisplay->wxWindow::Update();
}
void FrameMain::OnMedusaShiftEndForward(wxCommandEvent &event) {
audioBox->audioDisplay->curEndMS += 10;
audioBox->audioDisplay->Update();
audioBox->audioDisplay->wxWindow::Update();
}
void FrameMain::OnMedusaShiftEndBack(wxCommandEvent &event) {
audioBox->audioDisplay->curEndMS -= 10;
audioBox->audioDisplay->Update();
audioBox->audioDisplay->wxWindow::Update();
}
void FrameMain::OnMedusaPlayBefore(wxCommandEvent &event) {
int start=0,end=0;
audioBox->audioDisplay->GetTimesSelection(start,end);
audioBox->audioDisplay->Play(start-500,start);
}
void FrameMain::OnMedusaPlayAfter(wxCommandEvent &event) {
int start=0,end=0;
audioBox->audioDisplay->GetTimesSelection(start,end);
audioBox->audioDisplay->Play(end,end+500);
}