2006-01-16 22:02:54 +01:00
|
|
|
// Copyright (c) 2005, Rodrigo Braz Monteiro
|
|
|
|
// 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/
|
|
|
|
|
2014-05-23 00:40:16 +02:00
|
|
|
#include <wx/defs.h>
|
2011-09-29 07:33:04 +02:00
|
|
|
#include <wx/sashwin.h>
|
2009-09-11 04:36:34 +02:00
|
|
|
|
2012-04-21 17:13:46 +02:00
|
|
|
#include <libaegisub/signal.h>
|
|
|
|
|
2011-01-18 00:54:05 +01:00
|
|
|
namespace agi {
|
|
|
|
struct Context;
|
|
|
|
class OptionValue;
|
|
|
|
}
|
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
|
|
|
|
2011-08-27 08:30:42 +02:00
|
|
|
class AudioController;
|
|
|
|
class AudioDisplay;
|
|
|
|
class wxBitmapToggleButton;
|
|
|
|
class wxButton;
|
|
|
|
class wxCommandEvent;
|
2011-10-10 21:30:11 +02:00
|
|
|
class wxPanel;
|
2011-08-27 08:30:42 +02:00
|
|
|
class wxScrollEvent;
|
|
|
|
class wxSizer;
|
|
|
|
class wxSlider;
|
|
|
|
|
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
|
|
|
/// @class AudioBox
|
2010-12-08 04:36:10 +01:00
|
|
|
/// @brief Panel with audio playback and timing controls, also containing an AudioDisplay
|
2014-03-13 02:39:07 +01:00
|
|
|
class AudioBox final : public wxSashWindow {
|
2011-01-18 00:54:05 +01:00
|
|
|
/// The controller controlling this audio box
|
|
|
|
AudioController *controller;
|
|
|
|
|
|
|
|
/// Project context this operates on
|
|
|
|
agi::Context *context;
|
|
|
|
|
2012-04-21 17:13:46 +02:00
|
|
|
agi::signal::Connection audio_open_connection;
|
|
|
|
|
2011-09-29 07:33:04 +02:00
|
|
|
|
|
|
|
/// Panel containing the children
|
|
|
|
wxPanel *panel;
|
|
|
|
|
|
|
|
/// The audio display in the box
|
|
|
|
AudioDisplay *audioDisplay;
|
|
|
|
|
2006-01-16 22:02:54 +01:00
|
|
|
wxSlider *HorizontalZoom;
|
|
|
|
wxSlider *VerticalZoom;
|
2006-02-21 01:55:16 +01:00
|
|
|
wxSlider *VolumeBar;
|
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
|
|
|
|
2011-10-25 22:28:30 +02:00
|
|
|
// Mouse wheel zoom accumulator
|
2013-12-12 01:29:48 +01:00
|
|
|
int mouse_zoom_accum = 0;
|
2011-10-25 22:28:30 +02:00
|
|
|
|
2013-06-06 03:54:39 +02:00
|
|
|
void SetHorizontalZoom(int new_zoom);
|
2022-07-26 23:38:27 +02:00
|
|
|
void SetVerticalZoom(int new_zoom);
|
2012-04-21 17:13:46 +02:00
|
|
|
void OnAudioOpen();
|
2006-01-16 22:02:54 +01:00
|
|
|
void OnHorizontalZoom(wxScrollEvent &event);
|
2012-04-21 17:13:46 +02:00
|
|
|
void OnMouseWheel(wxMouseEvent &evt);
|
|
|
|
void OnSashDrag(wxSashEvent &event);
|
|
|
|
void OnVerticalLink(agi::OptionValue const& opt);
|
2006-01-16 22:02:54 +01:00
|
|
|
void OnVerticalZoom(wxScrollEvent &event);
|
2006-02-21 01:55:16 +01:00
|
|
|
void OnVolume(wxScrollEvent &event);
|
2011-01-18 00:54:05 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
AudioBox(wxWindow *parent, agi::Context *context);
|
2006-01-16 22:02:54 +01:00
|
|
|
|
2011-09-29 07:33:10 +02:00
|
|
|
void ShowKaraokeBar(bool show);
|
|
|
|
|
2011-09-30 22:41:56 +02:00
|
|
|
/// @brief Scroll the audio display
|
|
|
|
/// @param pixel_amount Number of pixels to scroll the view
|
|
|
|
///
|
|
|
|
/// A positive amount moves the display to the right, making later parts of the audio visible.
|
|
|
|
void ScrollAudioBy(int pixel_amount);
|
|
|
|
|
|
|
|
/// Make the currently active line visible in the audio display
|
|
|
|
void ScrollToActiveLine();
|
|
|
|
|
2006-01-19 11:33:56 +01:00
|
|
|
DECLARE_EVENT_TABLE()
|
2006-01-16 22:02:54 +01:00
|
|
|
};
|