2006-01-27 01:48:59 +01:00
|
|
|
// Copyright (c) 2005, Rodrigo Braz Monteiro, Niels Martin Hansen
|
2006-01-16 22:02:54 +01:00
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer.
|
|
|
|
// * Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer in the documentation
|
|
|
|
// and/or other materials provided with the distribution.
|
|
|
|
// * Neither the name of the Aegisub Group nor the names of its contributors
|
|
|
|
// may be used to endorse or promote products derived from this software
|
|
|
|
// without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
// POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
2006-01-16 22:02:54 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file audio_box.cpp
|
|
|
|
/// @brief The entire audio area in the main UI, containing display and related toolbars
|
|
|
|
/// @ingroup audio_ui
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
///////////
|
|
|
|
// Headers
|
2009-01-04 07:31:48 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2009-09-10 15:06:40 +02:00
|
|
|
#ifndef AGI_PRE
|
2006-01-16 22:02:54 +01:00
|
|
|
#include <math.h>
|
2009-09-10 15:06:40 +02:00
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
#include <wx/recguard.h>
|
2009-09-10 15:06:40 +02:00
|
|
|
#include <wx/statline.h>
|
|
|
|
#include <wx/tglbtn.h>
|
2009-09-11 00:48:29 +02:00
|
|
|
#include <wx/laywin.h> // Keep this last so wxSW_3D is set.
|
2009-09-10 15:06:40 +02:00
|
|
|
#endif
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
#include "audio_box.h"
|
|
|
|
#include "audio_display.h"
|
|
|
|
#include "audio_karaoke.h"
|
|
|
|
#include "frame_main.h"
|
2009-09-10 15:06:40 +02:00
|
|
|
#include "hotkeys.h"
|
|
|
|
#include "libresrc/libresrc.h"
|
2010-05-21 03:13:36 +02:00
|
|
|
#include "main.h"
|
2006-01-16 22:02:54 +01:00
|
|
|
#include "options.h"
|
|
|
|
#include "toggle_bitmap.h"
|
2007-06-30 22:59:32 +02:00
|
|
|
#include "tooltip_manager.h"
|
2009-07-25 18:15:13 +02:00
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// @brief Constructor
|
|
|
|
/// @param parent
|
|
|
|
///
|
2007-01-21 18:01:22 +01:00
|
|
|
AudioBox::AudioBox(wxWindow *parent) :
|
2006-01-16 22:02:54 +01:00
|
|
|
wxPanel(parent,-1,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL|wxBORDER_RAISED)
|
|
|
|
{
|
|
|
|
// Setup
|
|
|
|
loaded = false;
|
|
|
|
karaokeMode = false;
|
|
|
|
|
2007-04-04 02:52:50 +02:00
|
|
|
// Sash and Display
|
2006-01-16 22:02:54 +01:00
|
|
|
audioScroll = new wxScrollBar(this,Audio_Scrollbar);
|
2006-03-05 21:31:04 +01:00
|
|
|
audioScroll->PushEventHandler(new FocusEvent());
|
2006-01-16 22:02:54 +01:00
|
|
|
audioScroll->SetToolTip(_("Seek bar"));
|
|
|
|
Sash = new wxSashWindow(this,Audio_Sash,wxDefaultPosition,wxDefaultSize,wxCLIP_CHILDREN | wxSW_3DBORDER);
|
|
|
|
sashSizer = new wxBoxSizer(wxVERTICAL);
|
2007-01-21 18:01:22 +01:00
|
|
|
audioDisplay = new AudioDisplay(Sash);
|
2006-01-16 22:02:54 +01:00
|
|
|
sashSizer->Add(audioDisplay,1,wxEXPAND,0);
|
|
|
|
Sash->SetSizer(sashSizer);
|
|
|
|
Sash->SetSashVisible(wxSASH_BOTTOM,true);
|
2007-01-22 20:31:49 +01:00
|
|
|
//Sash->SetSashBorder(wxSASH_BOTTOM,true);
|
2006-01-16 22:02:54 +01:00
|
|
|
Sash->SetMinimumSizeY(50);
|
|
|
|
audioDisplay->ScrollBar = audioScroll;
|
|
|
|
audioDisplay->box = this;
|
2007-04-04 02:52:50 +02:00
|
|
|
int _w,_h;
|
|
|
|
audioDisplay->GetSize(&_w,&_h);
|
|
|
|
audioDisplay->SetSizeHints(-1,_h,-1,_h);
|
|
|
|
|
|
|
|
// Zoom
|
2007-09-22 02:53:05 +02:00
|
|
|
HorizontalZoom = new wxSlider(this,Audio_Horizontal_Zoom,50,0,100,wxDefaultPosition,wxSize(-1,20),wxSL_VERTICAL|wxSL_BOTH);
|
2006-03-05 21:31:04 +01:00
|
|
|
HorizontalZoom->PushEventHandler(new FocusEvent());
|
2006-01-16 22:02:54 +01:00
|
|
|
HorizontalZoom->SetToolTip(_("Horizontal zoom"));
|
2007-09-22 02:53:05 +02:00
|
|
|
VerticalZoom = new wxSlider(this,Audio_Vertical_Zoom,50,0,100,wxDefaultPosition,wxSize(-1,20),wxSL_VERTICAL|wxSL_BOTH|wxSL_INVERSE);
|
2006-03-05 21:31:04 +01:00
|
|
|
VerticalZoom->PushEventHandler(new FocusEvent());
|
2006-02-21 01:55:16 +01:00
|
|
|
VerticalZoom->SetToolTip(_("Vertical zoom"));
|
2007-09-22 02:53:05 +02:00
|
|
|
VolumeBar = new wxSlider(this,Audio_Volume,50,0,100,wxDefaultPosition,wxSize(-1,20),wxSL_VERTICAL|wxSL_BOTH|wxSL_INVERSE);
|
2006-03-05 21:31:04 +01:00
|
|
|
VolumeBar->PushEventHandler(new FocusEvent());
|
2006-02-21 01:55:16 +01:00
|
|
|
VolumeBar->SetToolTip(_("Audio Volume"));
|
2010-05-21 03:13:36 +02:00
|
|
|
bool link = OPT_GET("Audio/Link")->GetBool();
|
2007-01-05 19:27:15 +01:00
|
|
|
if (link) {
|
|
|
|
VolumeBar->SetValue(VerticalZoom->GetValue());
|
|
|
|
VolumeBar->Enable(false);
|
|
|
|
}
|
2009-07-25 06:49:59 +02:00
|
|
|
VerticalLink = new ToggleBitmap(this,Audio_Vertical_Link,GETIMAGE(toggle_audio_link_24));
|
2006-05-17 02:48:00 +02:00
|
|
|
VerticalLink->SetToolTip(_("Link vertical zoom and volume sliders"));
|
2007-01-05 19:27:15 +01:00
|
|
|
VerticalLink->SetValue(link);
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
// Display sizer
|
|
|
|
DisplaySizer = new wxBoxSizer(wxVERTICAL);
|
|
|
|
//DisplaySizer->Add(audioDisplay,1,wxEXPAND,0);
|
|
|
|
DisplaySizer->Add(Sash,0,wxEXPAND,0);
|
|
|
|
DisplaySizer->Add(audioScroll,0,wxEXPAND,0);
|
|
|
|
|
2006-02-21 01:55:16 +01:00
|
|
|
// VertVol sider
|
|
|
|
wxSizer *VertVol = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
VertVol->Add(VerticalZoom,1,wxEXPAND,0);
|
|
|
|
VertVol->Add(VolumeBar,1,wxEXPAND,0);
|
2008-01-22 21:36:07 +01:00
|
|
|
wxSizer *VertVolArea = new wxBoxSizer(wxVERTICAL);
|
2006-02-21 01:55:16 +01:00
|
|
|
VertVolArea->Add(VertVol,1,wxEXPAND,0);
|
|
|
|
VertVolArea->Add(VerticalLink,0,wxEXPAND,0);
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
// Top sizer
|
|
|
|
TopSizer = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
TopSizer->Add(DisplaySizer,1,wxEXPAND,0);
|
|
|
|
TopSizer->Add(HorizontalZoom,0,wxEXPAND,0);
|
2006-02-21 01:55:16 +01:00
|
|
|
TopSizer->Add(VertVolArea,0,wxEXPAND,0);
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
// Buttons sizer
|
|
|
|
wxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
wxButton *temp;
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Prev,GETIMAGE(button_prev_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Previous line or syllable (%KEY%/%KEY%)"),_T("Audio Prev Line"),_T("Audio Prev Line Alt"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Next,GETIMAGE(button_next_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Next line/syllable (%KEY%/%KEY%)"),_T("Audio Next Line"),_T("Audio Next Line Alt"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Play,GETIMAGE(button_playsel_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Play selection (%KEY%/%KEY%)"),_T("Audio Play"),_T("Audio Play Alt"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Play_Row,GETIMAGE(button_playline_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Play current line (%KEY%)"),_T("Audio Play Original Line"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Stop,GETIMAGE(button_stop_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Stop (%KEY%)"),_T("Audio Stop"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,10);
|
|
|
|
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Play_500ms_Before,GETIMAGE(button_playfivehbefore_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Play 500 ms before selection (%KEY%)"),_T("Audio Play 500ms Before"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Play_500ms_After,GETIMAGE(button_playfivehafter_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Play 500 ms after selection (%KEY%)"),_T("Audio Play 500ms after"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Play_500ms_First,GETIMAGE(button_playfirstfiveh_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Play first 500ms of selection (%KEY%)"),_T("Audio Play First 500ms"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Play_500ms_Last,GETIMAGE(button_playlastfiveh_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Play last 500ms of selection (%KEY%)"),_T("Audio Play Last 500ms"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Play_To_End,GETIMAGE(button_playtoend_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Play from selection start to end of file (%KEY%)"),_T("Audio Play To End"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,10);
|
|
|
|
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Leadin,GETIMAGE(button_leadin_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Add lead in (%KEY%)"),_T("Audio Add Lead In"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Leadout,GETIMAGE(button_leadout_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Add lead out (%KEY%)"),_T("Audio Add Lead Out"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,10);
|
|
|
|
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Commit,GETIMAGE(button_audio_commit_24),wxDefaultPosition,wxSize(30,-1));
|
2007-06-30 22:59:32 +02:00
|
|
|
ToolTipManager::Bind(temp,_("Commit changes (%KEY%/%KEY%)"),_T("Audio Commit (Stay)"),_T("Audio Commit Alt"));
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
temp = new wxBitmapButton(this,Audio_Button_Goto,GETIMAGE(button_audio_goto_24),wxDefaultPosition,wxSize(30,-1));
|
2006-01-16 22:02:54 +01:00
|
|
|
temp->SetToolTip(_("Go to selection"));
|
|
|
|
ButtonSizer->Add(temp,0,wxRIGHT,10);
|
|
|
|
|
2009-07-25 06:49:59 +02:00
|
|
|
AutoCommit = new ToggleBitmap(this,Audio_Check_AutoCommit,GETIMAGE(toggle_audio_autocommit_24),wxSize(30,-1));
|
2006-01-16 22:02:54 +01:00
|
|
|
AutoCommit->SetToolTip(_("Automatically commit all changes"));
|
2010-05-21 03:13:36 +02:00
|
|
|
AutoCommit->SetValue(OPT_GET("Audio/Auto/Commit")->GetBool());
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(AutoCommit,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
NextCommit = new ToggleBitmap(this,Audio_Check_NextCommit,GETIMAGE(toggle_audio_nextcommit_24),wxSize(30,-1));
|
2007-06-17 04:34:27 +02:00
|
|
|
NextCommit->SetToolTip(_("Auto goes to next line on commit"));
|
2010-05-21 03:13:36 +02:00
|
|
|
NextCommit->SetValue(OPT_GET("Audio/Next Line on Commit")->GetBool());
|
2007-06-17 04:34:27 +02:00
|
|
|
ButtonSizer->Add(NextCommit,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
AutoScroll = new ToggleBitmap(this,Audio_Check_AutoGoto,GETIMAGE(toggle_audio_autoscroll_24),wxSize(30,-1));
|
2006-01-16 22:02:54 +01:00
|
|
|
AutoScroll->SetToolTip(_("Auto scrolls audio display to selected line"));
|
2010-05-21 03:13:36 +02:00
|
|
|
AutoScroll->SetValue(OPT_GET("Audio/Auto/Scroll")->GetBool());
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(AutoScroll,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
SpectrumMode = new ToggleBitmap(this,Audio_Check_Spectrum,GETIMAGE(toggle_audio_spectrum_24),wxSize(30,-1));
|
2006-01-16 22:02:54 +01:00
|
|
|
SpectrumMode->SetToolTip(_("Spectrum analyzer mode"));
|
2010-05-21 03:13:36 +02:00
|
|
|
SpectrumMode->SetValue(OPT_GET("Audio/Spectrum")->GetBool());
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->Add(SpectrumMode,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0);
|
2009-07-25 06:49:59 +02:00
|
|
|
MedusaMode = new ToggleBitmap(this,Audio_Check_Medusa,GETIMAGE(toggle_audio_medusa_24),wxSize(30,-1));
|
2007-06-17 04:34:27 +02:00
|
|
|
MedusaMode->SetToolTip(_("Enable Medusa-Style Timing Shortcuts"));
|
2010-05-21 03:13:36 +02:00
|
|
|
MedusaMode->SetValue(OPT_GET("Audio/Medusa Timing Hotkeys")->GetBool());
|
2007-06-17 04:34:27 +02:00
|
|
|
ButtonSizer->Add(MedusaMode,0,wxRIGHT | wxALIGN_CENTER | wxEXPAND,0);
|
2006-01-16 22:02:54 +01:00
|
|
|
ButtonSizer->AddStretchSpacer(1);
|
|
|
|
|
|
|
|
// Karaoke sizer
|
2009-08-14 05:11:34 +02:00
|
|
|
karaokeSizer = new wxBoxSizer(wxHORIZONTAL);
|
2009-08-11 08:07:19 +02:00
|
|
|
KaraokeButton = new wxBitmapToggleButton(this,Audio_Button_Karaoke,GETIMAGE(kara_mode_24),wxDefaultPosition,wxSize(33,30));
|
2006-01-16 22:02:54 +01:00
|
|
|
KaraokeButton->SetToolTip(_("Toggle karaoke mode"));
|
2007-03-28 00:41:33 +02:00
|
|
|
karaokeSizer->Add(KaraokeButton,0,wxRIGHT|wxEXPAND,0);
|
2009-08-14 05:11:34 +02:00
|
|
|
|
|
|
|
JoinSplitSizer = new wxBoxSizer(wxHORIZONTAL);
|
2009-08-11 08:07:19 +02:00
|
|
|
JoinButton = new wxBitmapButton(this,Audio_Button_Join,GETIMAGE(kara_join_24),wxDefaultPosition,wxSize(33,30));
|
2009-08-14 05:11:34 +02:00
|
|
|
JoinButton->SetToolTip(_("Join selected syllables"));
|
2009-08-11 08:07:19 +02:00
|
|
|
SplitButton = new wxBitmapButton(this,Audio_Button_Split,GETIMAGE(kara_split_24),wxDefaultPosition,wxSize(33,30));
|
2009-08-14 05:11:34 +02:00
|
|
|
SplitButton->SetToolTip(_("Enter split-mode"));
|
|
|
|
JoinSplitSizer->Add(JoinButton,0,wxRIGHT|wxEXPAND,0);
|
|
|
|
JoinSplitSizer->Add(SplitButton,0,wxRIGHT|wxEXPAND,0);
|
|
|
|
|
|
|
|
CancelAcceptSizer = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
CancelButton = new wxBitmapButton(this,Audio_Button_Cancel,GETIMAGE(kara_split_accept_24),wxDefaultPosition,wxSize(33,30));
|
2009-08-14 06:57:32 +02:00
|
|
|
CancelButton->SetToolTip(_("Commit splits and leave split-mode"));
|
2009-08-14 05:11:34 +02:00
|
|
|
AcceptButton = new wxBitmapButton(this,Audio_Button_Accept,GETIMAGE(kara_split_cancel_24),wxDefaultPosition,wxSize(33,30));
|
2009-08-14 06:57:32 +02:00
|
|
|
AcceptButton->SetToolTip(_("Discard all splits and leave split-mode"));
|
2009-08-14 05:11:34 +02:00
|
|
|
CancelAcceptSizer->Add(CancelButton,0,wxRIGHT|wxEXPAND,0);
|
|
|
|
CancelAcceptSizer->Add(AcceptButton,0,wxRIGHT|wxEXPAND,0);
|
|
|
|
|
|
|
|
karaokeSizer->Add(JoinSplitSizer,0,wxRIGHT|wxEXPAND,0);
|
|
|
|
karaokeSizer->Add(CancelAcceptSizer,0,wxRIGHT|wxEXPAND,0);
|
|
|
|
|
|
|
|
audioKaraoke = new AudioKaraoke(this);
|
|
|
|
audioKaraoke->box = this;
|
|
|
|
audioKaraoke->display = audioDisplay;
|
|
|
|
audioDisplay->karaoke = audioKaraoke;
|
2006-01-16 22:02:54 +01:00
|
|
|
karaokeSizer->Add(audioKaraoke,1,wxEXPAND,0);
|
2009-08-14 05:11:34 +02:00
|
|
|
|
|
|
|
SetKaraokeButtons(); // Decide which one to show or hide.
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
// Main sizer
|
|
|
|
MainSizer = new wxBoxSizer(wxVERTICAL);
|
|
|
|
MainSizer->Add(TopSizer,0,wxEXPAND,0);
|
|
|
|
MainSizer->Add(ButtonSizer,0,wxEXPAND,0);
|
|
|
|
MainSizer->Add(new wxStaticLine(this),0,wxEXPAND|wxTOP|wxBOTTOM,2);
|
|
|
|
MainSizer->Add(karaokeSizer,0,wxEXPAND,0);
|
|
|
|
//MainSizer->SetSizeHints(this);
|
|
|
|
SetSizer(MainSizer);
|
2009-08-14 05:11:34 +02:00
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Destructor
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
AudioBox::~AudioBox() {
|
2009-05-18 07:33:49 +02:00
|
|
|
audioScroll->PopEventHandler(true);
|
|
|
|
HorizontalZoom->PopEventHandler(true);
|
|
|
|
VerticalZoom->PopEventHandler(true);
|
|
|
|
VolumeBar->PopEventHandler(true);
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Set file
|
|
|
|
/// @param file
|
|
|
|
/// @param FromVideo
|
|
|
|
/// @return
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::SetFile(wxString file,bool FromVideo) {
|
2007-06-20 04:18:55 +02:00
|
|
|
wxLogDebug(_T("AudioBox::SetFile(file=%s, FromVideo=%d)"), file.c_str(), FromVideo?1:0);
|
2006-01-16 22:02:54 +01:00
|
|
|
loaded = false;
|
|
|
|
|
|
|
|
if (FromVideo) {
|
|
|
|
audioDisplay->SetFromVideo();
|
|
|
|
loaded = audioDisplay->loaded;
|
|
|
|
audioName = _T("?video");
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
audioDisplay->SetFile(file);
|
|
|
|
if (file != _T("")) loaded = audioDisplay->loaded;
|
|
|
|
audioName = file;
|
|
|
|
}
|
2006-12-30 23:08:23 +01:00
|
|
|
|
2007-06-20 04:18:55 +02:00
|
|
|
wxLogDebug(_T("AudioBox::SetFile: setting up accelerators in frameMain"));
|
2006-12-30 23:08:23 +01:00
|
|
|
frameMain->SetAccelerators();
|
2007-06-20 04:18:55 +02:00
|
|
|
wxLogDebug(_T("AudioBox::SetFile: returning"));
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
///////////////
|
|
|
|
// Event table
|
|
|
|
BEGIN_EVENT_TABLE(AudioBox,wxPanel)
|
|
|
|
EVT_COMMAND_SCROLL(Audio_Scrollbar, AudioBox::OnScrollbar)
|
|
|
|
EVT_COMMAND_SCROLL(Audio_Horizontal_Zoom, AudioBox::OnHorizontalZoom)
|
|
|
|
EVT_COMMAND_SCROLL(Audio_Vertical_Zoom, AudioBox::OnVerticalZoom)
|
2006-02-21 01:55:16 +01:00
|
|
|
EVT_COMMAND_SCROLL(Audio_Volume, AudioBox::OnVolume)
|
2006-01-16 22:02:54 +01:00
|
|
|
EVT_SASH_DRAGGED(Audio_Sash,AudioBox::OnSash)
|
|
|
|
|
|
|
|
EVT_BUTTON(Audio_Button_Play, AudioBox::OnPlaySelection)
|
|
|
|
EVT_BUTTON(Audio_Button_Play_Row, AudioBox::OnPlayDialogue)
|
|
|
|
EVT_BUTTON(Audio_Button_Stop, AudioBox::OnStop)
|
|
|
|
EVT_BUTTON(Audio_Button_Next, AudioBox::OnNext)
|
|
|
|
EVT_BUTTON(Audio_Button_Prev, AudioBox::OnPrev)
|
|
|
|
EVT_BUTTON(Audio_Button_Play_500ms_Before, AudioBox::OnPlay500Before)
|
|
|
|
EVT_BUTTON(Audio_Button_Play_500ms_After, AudioBox::OnPlay500After)
|
|
|
|
EVT_BUTTON(Audio_Button_Play_500ms_First, AudioBox::OnPlay500First)
|
|
|
|
EVT_BUTTON(Audio_Button_Play_500ms_Last, AudioBox::OnPlay500Last)
|
|
|
|
EVT_BUTTON(Audio_Button_Play_To_End, AudioBox::OnPlayToEnd)
|
|
|
|
EVT_BUTTON(Audio_Button_Commit, AudioBox::OnCommit)
|
|
|
|
EVT_BUTTON(Audio_Button_Goto, AudioBox::OnGoto)
|
|
|
|
EVT_BUTTON(Audio_Button_Join,AudioBox::OnJoin)
|
2007-06-23 01:28:28 +02:00
|
|
|
EVT_BUTTON(Audio_Button_Split,AudioBox::OnSplit)
|
2009-08-14 05:11:34 +02:00
|
|
|
EVT_BUTTON(Audio_Button_Cancel,AudioBox::OnCancel)
|
|
|
|
EVT_BUTTON(Audio_Button_Accept,AudioBox::OnAccept)
|
2006-01-16 22:02:54 +01:00
|
|
|
EVT_BUTTON(Audio_Button_Leadin,AudioBox::OnLeadIn)
|
|
|
|
EVT_BUTTON(Audio_Button_Leadout,AudioBox::OnLeadOut)
|
|
|
|
|
2006-02-21 01:55:16 +01:00
|
|
|
EVT_TOGGLEBUTTON(Audio_Vertical_Link, AudioBox::OnVerticalLink)
|
2006-01-16 22:02:54 +01:00
|
|
|
EVT_TOGGLEBUTTON(Audio_Button_Karaoke, AudioBox::OnKaraoke)
|
|
|
|
EVT_TOGGLEBUTTON(Audio_Check_AutoGoto,AudioBox::OnAutoGoto)
|
2006-12-30 23:08:23 +01:00
|
|
|
EVT_TOGGLEBUTTON(Audio_Check_Medusa,AudioBox::OnMedusaMode)
|
2006-01-16 22:02:54 +01:00
|
|
|
EVT_TOGGLEBUTTON(Audio_Check_Spectrum,AudioBox::OnSpectrumMode)
|
|
|
|
EVT_TOGGLEBUTTON(Audio_Check_AutoCommit,AudioBox::OnAutoCommit)
|
2007-06-17 04:34:27 +02:00
|
|
|
EVT_TOGGLEBUTTON(Audio_Check_NextCommit,AudioBox::OnNextLineCommit)
|
2006-01-16 22:02:54 +01:00
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Scrollbar changed
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnScrollbar(wxScrollEvent &event) {
|
|
|
|
audioDisplay->SetPosition(event.GetPosition()*12);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Horizontal zoom bar changed
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnHorizontalZoom(wxScrollEvent &event) {
|
|
|
|
audioDisplay->SetSamplesPercent(event.GetPosition());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Vertical zoom bar changed
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnVerticalZoom(wxScrollEvent &event) {
|
|
|
|
int pos = event.GetPosition();
|
|
|
|
if (pos < 1) pos = 1;
|
|
|
|
if (pos > 100) pos = 100;
|
2006-02-21 01:55:16 +01:00
|
|
|
float value = pow(float(pos)/50.0f,3);
|
|
|
|
audioDisplay->SetScale(value);
|
|
|
|
if (VerticalLink->GetValue()) {
|
2006-02-25 08:41:18 +01:00
|
|
|
audioDisplay->player->SetVolume(value);
|
2006-02-21 01:55:16 +01:00
|
|
|
VolumeBar->SetValue(pos);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Volume bar changed
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-02-21 01:55:16 +01:00
|
|
|
void AudioBox::OnVolume(wxScrollEvent &event) {
|
|
|
|
if (!VerticalLink->GetValue()) {
|
|
|
|
int pos = event.GetPosition();
|
|
|
|
if (pos < 1) pos = 1;
|
|
|
|
if (pos > 100) pos = 100;
|
2006-02-25 08:41:18 +01:00
|
|
|
audioDisplay->player->SetVolume(pow(float(pos)/50.0f,3));
|
2006-02-21 01:55:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Bars linked/unlinked
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-02-21 01:55:16 +01:00
|
|
|
void AudioBox::OnVerticalLink(wxCommandEvent &event) {
|
|
|
|
int pos = VerticalZoom->GetValue();
|
|
|
|
if (pos < 1) pos = 1;
|
|
|
|
if (pos > 100) pos = 100;
|
|
|
|
float value = pow(float(pos)/50.0f,3);
|
|
|
|
if (VerticalLink->GetValue()) {
|
2006-02-25 08:41:18 +01:00
|
|
|
audioDisplay->player->SetVolume(value);
|
2006-02-21 01:55:16 +01:00
|
|
|
VolumeBar->SetValue(pos);
|
|
|
|
}
|
|
|
|
VolumeBar->Enable(!VerticalLink->GetValue());
|
|
|
|
|
2010-05-21 03:13:36 +02:00
|
|
|
OPT_SET("Audio/Link")->SetBool(VerticalLink->GetValue());
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Sash
|
|
|
|
/// @param event
|
|
|
|
/// @return
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnSash(wxSashEvent& event) {
|
|
|
|
// OK?
|
|
|
|
if (event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE) return;
|
|
|
|
|
|
|
|
// Recursion guard
|
|
|
|
static wxRecursionGuardFlag inside;
|
|
|
|
wxRecursionGuard guard(inside);
|
|
|
|
if (guard.IsInside()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get size
|
|
|
|
wxRect newSize = event.GetDragRect();
|
|
|
|
int w = newSize.GetWidth();
|
|
|
|
int h = newSize.GetHeight();
|
|
|
|
if (h < 50) h = 50;
|
|
|
|
int oldh = audioDisplay->GetSize().GetHeight();
|
|
|
|
if (oldh == h) return;
|
|
|
|
|
|
|
|
// Resize
|
2007-04-04 02:52:50 +02:00
|
|
|
audioDisplay->SetSizeHints(w,h,-1,h);
|
2007-04-04 01:29:51 +02:00
|
|
|
audioDisplay->SetSize(w,h);
|
|
|
|
sashSizer->Layout();
|
|
|
|
Sash->GetParent()->Layout();
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
// Store new size
|
2010-05-21 03:13:36 +02:00
|
|
|
OPT_SET("Audio/Display Height")->SetInt(h);
|
2006-01-16 22:02:54 +01:00
|
|
|
|
|
|
|
// Fix layout
|
|
|
|
frameMain->Freeze();
|
|
|
|
DisplaySizer->Layout();
|
|
|
|
//TopSizer->Layout();
|
|
|
|
//MainSizer->Layout();
|
|
|
|
Layout();
|
|
|
|
frameMain->ToolSizer->Layout();
|
|
|
|
frameMain->MainSizer->Layout();
|
|
|
|
frameMain->Layout();
|
|
|
|
frameMain->Refresh();
|
|
|
|
frameMain->Thaw();
|
|
|
|
|
|
|
|
//event.Skip();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Play selection
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnPlaySelection(wxCommandEvent &event) {
|
|
|
|
int start=0,end=0;
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->GetTimesSelection(start,end);
|
|
|
|
audioDisplay->Play(start,end);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Play dialogue
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnPlayDialogue(wxCommandEvent &event) {
|
|
|
|
int start=0,end=0;
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->GetTimesDialogue(start,end);
|
|
|
|
audioDisplay->SetSelection(start, end);
|
|
|
|
audioDisplay->Play(start,end);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Stop Playing
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnStop(wxCommandEvent &event) {
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->Stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Next
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnNext(wxCommandEvent &event) {
|
|
|
|
audioDisplay->SetFocus();
|
2006-07-02 01:31:15 +02:00
|
|
|
audioDisplay->Stop();
|
2006-01-16 22:02:54 +01:00
|
|
|
audioDisplay->Next();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Previous
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnPrev(wxCommandEvent &event) {
|
|
|
|
audioDisplay->SetFocus();
|
2006-07-02 01:31:15 +02:00
|
|
|
audioDisplay->Stop();
|
2006-01-16 22:02:54 +01:00
|
|
|
audioDisplay->Prev();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief 500 ms before
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnPlay500Before(wxCommandEvent &event) {
|
|
|
|
int start=0,end=0;
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->GetTimesSelection(start,end);
|
|
|
|
audioDisplay->Play(start-500,start);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief 500 ms after
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnPlay500After(wxCommandEvent &event) {
|
|
|
|
int start=0,end=0;
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->GetTimesSelection(start,end);
|
|
|
|
audioDisplay->Play(end,end+500);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief First 500 ms
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnPlay500First(wxCommandEvent &event) {
|
|
|
|
int start=0,end=0;
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->GetTimesSelection(start,end);
|
|
|
|
int endp = start+500;
|
|
|
|
if (endp > end) endp = end;
|
|
|
|
audioDisplay->Play(start,endp);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Last 500 ms
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnPlay500Last(wxCommandEvent &event) {
|
|
|
|
int start=0,end=0;
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->GetTimesSelection(start,end);
|
|
|
|
int startp = end-500;
|
|
|
|
if (startp < start) startp = start;
|
|
|
|
audioDisplay->Play(startp,end);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Start to end of file
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnPlayToEnd(wxCommandEvent &event) {
|
|
|
|
int start=0,end=0;
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->GetTimesSelection(start,end);
|
|
|
|
audioDisplay->Play(start,-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Commit changes
|
|
|
|
/// @param event
|
|
|
|
/// @return
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnCommit(wxCommandEvent &event) {
|
2007-06-20 04:18:55 +02:00
|
|
|
wxLogDebug(_T("AudioBox::OnCommit"));
|
2006-01-16 22:02:54 +01:00
|
|
|
audioDisplay->SetFocus();
|
2007-06-20 04:18:55 +02:00
|
|
|
wxLogDebug(_T("AudioBox::OnCommit: has set focus, now committing changes"));
|
2007-01-06 04:40:58 +01:00
|
|
|
audioDisplay->CommitChanges(true);
|
2007-06-20 04:18:55 +02:00
|
|
|
wxLogDebug(_T("AudioBox::OnCommit: returning"));
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Toggle karaoke
|
|
|
|
/// @param event
|
|
|
|
/// @return
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnKaraoke(wxCommandEvent &event) {
|
2007-06-20 04:18:55 +02:00
|
|
|
wxLogDebug(_T("AudioBox::OnKaraoke"));
|
2006-01-16 22:02:54 +01:00
|
|
|
audioDisplay->SetFocus();
|
|
|
|
if (karaokeMode) {
|
2007-06-20 04:18:55 +02:00
|
|
|
wxLogDebug(_T("AudioBox::OnKaraoke: karaoke enabled, disabling"));
|
2006-01-27 01:48:59 +01:00
|
|
|
if (audioKaraoke->splitting) {
|
2007-07-03 20:28:08 +02:00
|
|
|
audioKaraoke->EndSplit(false);
|
2006-01-27 01:48:59 +01:00
|
|
|
}
|
2006-01-16 22:02:54 +01:00
|
|
|
karaokeMode = false;
|
|
|
|
audioKaraoke->enabled = false;
|
|
|
|
audioDisplay->SetDialogue();
|
|
|
|
audioKaraoke->Refresh(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
2007-06-20 04:18:55 +02:00
|
|
|
wxLogDebug(_T("AudioBox::OnKaraoke: karaoke disabled, enabling"));
|
2006-01-16 22:02:54 +01:00
|
|
|
karaokeMode = true;
|
|
|
|
audioKaraoke->enabled = true;
|
|
|
|
audioDisplay->SetDialogue();
|
|
|
|
}
|
2009-08-14 05:11:34 +02:00
|
|
|
|
2007-08-15 22:41:57 +02:00
|
|
|
SetKaraokeButtons();
|
2007-06-20 04:18:55 +02:00
|
|
|
|
|
|
|
wxLogDebug(_T("AudioBox::OnKaraoke: returning"));
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Sets karaoke buttons
|
|
|
|
///
|
2007-06-23 01:28:28 +02:00
|
|
|
void AudioBox::SetKaraokeButtons() {
|
|
|
|
// What to enable
|
|
|
|
bool join,split;
|
|
|
|
join = audioKaraoke->enabled && (audioKaraoke->splitting || audioKaraoke->selectionCount>=2);
|
|
|
|
split = audioKaraoke->enabled;
|
|
|
|
|
2007-08-16 00:33:38 +02:00
|
|
|
// If we set focus here, the audio display will continually steal the focus
|
|
|
|
// when navigating via the grid and karaoke is enabled. So don't.
|
|
|
|
//audioDisplay->SetFocus();
|
|
|
|
|
2007-06-23 01:28:28 +02:00
|
|
|
JoinButton->Enable(join);
|
2006-01-16 22:02:54 +01:00
|
|
|
SplitButton->Enable(split);
|
2006-01-27 01:48:59 +01:00
|
|
|
if (audioKaraoke->splitting) {
|
2009-08-14 05:11:34 +02:00
|
|
|
karaokeSizer->Show(CancelAcceptSizer);
|
|
|
|
karaokeSizer->Hide(JoinSplitSizer);
|
|
|
|
karaokeSizer->Layout();
|
2006-01-27 01:48:59 +01:00
|
|
|
} else {
|
2009-08-14 05:11:34 +02:00
|
|
|
karaokeSizer->Hide(CancelAcceptSizer);
|
|
|
|
karaokeSizer->Show(JoinSplitSizer);
|
|
|
|
karaokeSizer->Layout();
|
2006-01-27 01:48:59 +01:00
|
|
|
}
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
2009-08-14 05:11:34 +02:00
|
|
|
/// @brief Join button in karaoke mode
|
|
|
|
/// @param event wxEvent
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnJoin(wxCommandEvent &event) {
|
2007-06-20 04:18:55 +02:00
|
|
|
wxLogDebug(_T("AudioBox::OnJoin"));
|
2006-01-16 22:02:54 +01:00
|
|
|
audioDisplay->SetFocus();
|
2009-08-14 05:11:34 +02:00
|
|
|
audioKaraoke->Join();
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
2009-08-14 05:11:34 +02:00
|
|
|
/// @brief Split button in karaoke mode
|
|
|
|
/// @param event wxEvent
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnSplit(wxCommandEvent &event) {
|
2007-06-20 04:18:55 +02:00
|
|
|
wxLogDebug(_T("AudioBox::OnSplit"));
|
2006-01-16 22:02:54 +01:00
|
|
|
audioDisplay->SetFocus();
|
2006-01-27 01:48:59 +01:00
|
|
|
audioKaraoke->BeginSplit();
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
2009-08-14 05:11:34 +02:00
|
|
|
/// @brief Cancel join/split in karaoke mode.
|
|
|
|
/// @param event wxEvent
|
|
|
|
///
|
|
|
|
void AudioBox::OnCancel(wxCommandEvent &event) {
|
|
|
|
wxLogDebug(_T("AudioBox::OnCancel"));
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioKaraoke->EndSplit(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// @brief Accept join/split button in karaoke mode.
|
|
|
|
/// @param event wxEvent
|
|
|
|
///
|
|
|
|
void AudioBox::OnAccept(wxCommandEvent &event) {
|
|
|
|
wxLogDebug(_T("AudioBox::OnAccept"));
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioKaraoke->EndSplit(false);
|
|
|
|
}
|
2006-01-16 22:02:54 +01:00
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Goto button
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnGoto(wxCommandEvent &event) {
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->MakeDialogueVisible(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Auto Goto
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnAutoGoto(wxCommandEvent &event) {
|
|
|
|
audioDisplay->SetFocus();
|
2010-05-21 03:13:36 +02:00
|
|
|
OPT_SET("Audio/Auto/Scroll")->SetBool(AutoScroll->GetValue());
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Auto Commit
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnAutoCommit(wxCommandEvent &event) {
|
|
|
|
audioDisplay->SetFocus();
|
2010-05-21 03:13:36 +02:00
|
|
|
OPT_SET("Audio/Auto/Commit")->SetBool(AutoCommit->GetValue());
|
2006-01-16 22:02:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Next line on Commit
|
|
|
|
/// @param event
|
|
|
|
///
|
2007-06-17 04:34:27 +02:00
|
|
|
void AudioBox::OnNextLineCommit(wxCommandEvent &event) {
|
|
|
|
audioDisplay->SetFocus();
|
2010-05-21 03:13:36 +02:00
|
|
|
OPT_SET("Audio/Next Line on Commit")->SetBool(NextCommit->GetValue());
|
2007-06-17 04:34:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Medusa Mode
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-12-30 23:08:23 +01:00
|
|
|
void AudioBox::OnMedusaMode(wxCommandEvent &event) {
|
|
|
|
audioDisplay->SetFocus();
|
2010-05-21 03:13:36 +02:00
|
|
|
OPT_SET("Audio/Medusa Timing Hotkeys")->SetBool(MedusaMode->GetValue());
|
2006-12-30 23:08:23 +01:00
|
|
|
frameMain->SetAccelerators();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Spectrum Analyzer Mode
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnSpectrumMode(wxCommandEvent &event) {
|
2010-05-21 03:13:36 +02:00
|
|
|
OPT_SET("Audio/Spectrum")->SetBool(SpectrumMode->GetValue());
|
2006-01-16 22:02:54 +01:00
|
|
|
audioDisplay->UpdateImage(false);
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->Refresh(false);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief Lead in/out
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnLeadIn(wxCommandEvent &event) {
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->AddLead(true,false);
|
|
|
|
}
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief DOCME
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-01-16 22:02:54 +01:00
|
|
|
void AudioBox::OnLeadOut(wxCommandEvent &event) {
|
|
|
|
audioDisplay->SetFocus();
|
|
|
|
audioDisplay->AddLead(false,true);
|
|
|
|
}
|
2006-03-05 21:31:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////
|
|
|
|
// Focus event handling for the scrollbar
|
|
|
|
BEGIN_EVENT_TABLE(FocusEvent,wxEvtHandler)
|
|
|
|
EVT_SET_FOCUS(FocusEvent::OnSetFocus)
|
|
|
|
END_EVENT_TABLE()
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// @brief DOCME
|
|
|
|
/// @param event
|
|
|
|
///
|
2006-03-05 21:31:04 +01:00
|
|
|
void FocusEvent::OnSetFocus(wxFocusEvent &event) {
|
|
|
|
wxWindow *previous = event.GetWindow();
|
|
|
|
if (previous) previous->SetFocus();
|
|
|
|
}
|