From: <pst...@us...> - 2008-09-01 22:23:47
|
Revision: 606 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=606&view=rev Author: pstieber Date: 2008-09-01 22:23:44 +0000 (Mon, 01 Sep 2008) Log Message: ----------- Removed build configurations that were added by Visual Studio when the porttime and portmidi projects were added. Modified Paths: -------------- trunk/jazz/vc8/JazzPlusPlus-VC8.sln trunk/jazz/vc9/JazzPlusPlus-VC9.sln Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.sln =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.sln 2008-06-14 20:41:24 UTC (rev 605) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.sln 2008-09-01 22:23:44 UTC (rev 606) @@ -13,35 +13,21 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug GUI VC8|Win32 = Debug GUI VC8|Win32 - Debug VC8|Win32 = Debug VC8|Win32 Release GUI VC8|Win32 = Release GUI VC8|Win32 - Release VC8|Win32 = Release VC8|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Debug GUI VC8|Win32.ActiveCfg = Debug GUI VC8|Win32 {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Debug GUI VC8|Win32.Build.0 = Debug GUI VC8|Win32 - {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Debug VC8|Win32.ActiveCfg = Debug GUI VC8|Win32 - {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Debug VC8|Win32.Build.0 = Debug GUI VC8|Win32 {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Release GUI VC8|Win32.ActiveCfg = Release GUI VC8|Win32 {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Release GUI VC8|Win32.Build.0 = Release GUI VC8|Win32 - {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Release VC8|Win32.ActiveCfg = Release GUI VC8|Win32 - {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Release VC8|Win32.Build.0 = Release GUI VC8|Win32 {338224B8-D575-408D-BACF-95C557B429BE}.Debug GUI VC8|Win32.ActiveCfg = Debug VC8|Win32 {338224B8-D575-408D-BACF-95C557B429BE}.Debug GUI VC8|Win32.Build.0 = Debug VC8|Win32 - {338224B8-D575-408D-BACF-95C557B429BE}.Debug VC8|Win32.ActiveCfg = Debug VC8|Win32 - {338224B8-D575-408D-BACF-95C557B429BE}.Debug VC8|Win32.Build.0 = Debug VC8|Win32 {338224B8-D575-408D-BACF-95C557B429BE}.Release GUI VC8|Win32.ActiveCfg = Release VC8|Win32 {338224B8-D575-408D-BACF-95C557B429BE}.Release GUI VC8|Win32.Build.0 = Release VC8|Win32 - {338224B8-D575-408D-BACF-95C557B429BE}.Release VC8|Win32.ActiveCfg = Release VC8|Win32 - {338224B8-D575-408D-BACF-95C557B429BE}.Release VC8|Win32.Build.0 = Release VC8|Win32 {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Debug GUI VC8|Win32.ActiveCfg = Debug VC8|Win32 {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Debug GUI VC8|Win32.Build.0 = Debug VC8|Win32 - {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Debug VC8|Win32.ActiveCfg = Debug VC8|Win32 - {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Debug VC8|Win32.Build.0 = Debug VC8|Win32 {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Release GUI VC8|Win32.ActiveCfg = Release VC8|Win32 {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Release GUI VC8|Win32.Build.0 = Release VC8|Win32 - {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Release VC8|Win32.ActiveCfg = Release VC8|Win32 - {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Release VC8|Win32.Build.0 = Release VC8|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.sln =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.sln 2008-06-14 20:41:24 UTC (rev 605) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.sln 2008-09-01 22:23:44 UTC (rev 606) @@ -13,35 +13,21 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug GUI VC9|Win32 = Debug GUI VC9|Win32 - Debug VC8|Win32 = Debug VC8|Win32 Release GUI VC9|Win32 = Release GUI VC9|Win32 - Release VC8|Win32 = Release VC8|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Debug GUI VC9|Win32.ActiveCfg = Debug GUI VC9|Win32 {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Debug GUI VC9|Win32.Build.0 = Debug GUI VC9|Win32 - {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Debug VC8|Win32.ActiveCfg = Debug GUI VC9|Win32 - {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Debug VC8|Win32.Build.0 = Debug GUI VC9|Win32 {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Release GUI VC9|Win32.ActiveCfg = Release GUI VC9|Win32 {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Release GUI VC9|Win32.Build.0 = Release GUI VC9|Win32 - {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Release VC8|Win32.ActiveCfg = Release GUI VC9|Win32 - {8C82269C-4753-428B-B9B1-D21B46C6AD83}.Release VC8|Win32.Build.0 = Release GUI VC9|Win32 {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Debug GUI VC9|Win32.ActiveCfg = Debug VC8|Win32 {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Debug GUI VC9|Win32.Build.0 = Debug VC8|Win32 - {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Debug VC8|Win32.ActiveCfg = Debug VC8|Win32 - {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Debug VC8|Win32.Build.0 = Debug VC8|Win32 {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Release GUI VC9|Win32.ActiveCfg = Release VC8|Win32 {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Release GUI VC9|Win32.Build.0 = Release VC8|Win32 - {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Release VC8|Win32.ActiveCfg = Release VC8|Win32 - {33E3B196-B9F4-4D0A-85E1-31C7BBD4967A}.Release VC8|Win32.Build.0 = Release VC8|Win32 {338224B8-D575-408D-BACF-95C557B429BE}.Debug GUI VC9|Win32.ActiveCfg = Debug VC8|Win32 {338224B8-D575-408D-BACF-95C557B429BE}.Debug GUI VC9|Win32.Build.0 = Debug VC8|Win32 - {338224B8-D575-408D-BACF-95C557B429BE}.Debug VC8|Win32.ActiveCfg = Debug VC8|Win32 - {338224B8-D575-408D-BACF-95C557B429BE}.Debug VC8|Win32.Build.0 = Debug VC8|Win32 {338224B8-D575-408D-BACF-95C557B429BE}.Release GUI VC9|Win32.ActiveCfg = Release VC8|Win32 {338224B8-D575-408D-BACF-95C557B429BE}.Release GUI VC9|Win32.Build.0 = Release VC8|Win32 - {338224B8-D575-408D-BACF-95C557B429BE}.Release VC8|Win32.ActiveCfg = Release VC8|Win32 - {338224B8-D575-408D-BACF-95C557B429BE}.Release VC8|Win32.Build.0 = Release VC8|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2008-11-07 18:46:54
|
Revision: 612 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=612&view=rev Author: pstieber Date: 2008-11-07 18:46:50 +0000 (Fri, 07 Nov 2008) Log Message: ----------- 1. Moved the location of some configure argument checks. 2. Fixed the selcted actionargument to AC_ARG_ENABLE. 3. Set wx_config_args to --debug if debug was enabled. This will require a debug build of wxWidgets. 4. Updated the rwquired version of wxWidgets to 2.8.9 in the trunk. Modified Paths: -------------- branches/jazz-4.1.9/configure.ac tex2rtf/configure.ac trunk/jazz/configure.ac Modified: branches/jazz-4.1.9/configure.ac =================================================================== --- branches/jazz-4.1.9/configure.ac 2008-10-08 03:23:28 UTC (rev 611) +++ branches/jazz-4.1.9/configure.ac 2008-11-07 18:46:50 UTC (rev 612) @@ -95,7 +95,7 @@ AC_HELP_STRING( [--enable-sequencer2], [enable sequencer2 support (off by default)]), - ac_arg_profile="yes", + ac_arg_profile="$enableval", ac_arg_profile="no") AC_MSG_RESULT(${enable_sequencer2-no}) @@ -119,6 +119,10 @@ dnl Check for wxWidgets +if test x$ac_arg_debug = xyes ; then + wx_config_args=--debug +fi + AM_OPTIONS_WXCONFIG AM_PATH_WXCONFIG(2.8.7, wxWin=1) Modified: tex2rtf/configure.ac =================================================================== --- tex2rtf/configure.ac 2008-10-08 03:23:28 UTC (rev 611) +++ tex2rtf/configure.ac 2008-11-07 18:46:50 UTC (rev 612) @@ -58,6 +58,36 @@ dnl Check for st_blksize in struct stat AC_ST_BLKSIZE +AC_MSG_CHECKING([whether to enable debugging]) +AC_ARG_ENABLE( + debug, + AC_HELP_STRING( + [--enable-debug], + [enable debugging code (off by default)]), + ac_arg_debug="$enableval", + ac_arg_debug="no") +AC_MSG_RESULT(${enable_debug-no}) + +AC_MSG_CHECKING([whether to enable optimization]) +AC_ARG_ENABLE( + optimize, + AC_HELP_STRING( + [--enable-optimize@<:@=ARG@:>@], + [enable optimized code with ARG = 0, 1, 2, or 3 (off by default ARG = 0)]), + [opt_level="$enableval" ac_arg_optimize="yes"], + ac_arg_optimize="no") +AC_MSG_RESULT(${enable_optimize-no}) + +AC_MSG_CHECKING([whether to enable profiling]) +AC_ARG_ENABLE( + profile, + AC_HELP_STRING( + [--enable-profile], + [enable gprof profiling code (off by default)]), + ac_arg_profile="$enableval", + ac_arg_profile="no") +AC_MSG_RESULT(${enable_profile-no}) + dnl To support a new system, you need to add its canonical name (as determined dnl by config.sub or specified by the configure command line) to this "case" dnl and also define the shared library flags below - search for @@ -71,6 +101,10 @@ AC_MSG_ERROR(unknown system type ${host}.) esac +if test x$ac_arg_debug = xyes ; then + wx_config_args=--debug +fi + dnl Check for wxWidgets AM_OPTIONS_WXCONFIG @@ -92,36 +126,6 @@ TEX2RTF_PATH=\${top_srcdir} AC_SUBST(TEX2RTF_PATH) -AC_MSG_CHECKING([whether to enable debugging]) -AC_ARG_ENABLE( - debug, - AC_HELP_STRING( - [--enable-debug], - [enable debugging code (off by default)]), - ac_arg_debug="yes", - ac_arg_debug="no") -AC_MSG_RESULT(${enable_debug-no}) - -AC_MSG_CHECKING([whether to enable optimization]) -AC_ARG_ENABLE( - optimize, - AC_HELP_STRING( - [--enable-optimize@<:@=ARG@:>@], - [enable optimized code with ARG = 0, 1, 2, or 3 (off by default ARG = 0)]), - [opt_level="$enableval" ac_arg_optimize="yes"], - ac_arg_optimize="no") -AC_MSG_RESULT(${enable_optimize-no}) - -AC_MSG_CHECKING([whether to enable profiling]) -AC_ARG_ENABLE( - profile, - AC_HELP_STRING( - [--enable-profile], - [enable gprof profiling code (off by default)]), - ac_arg_profile="yes", - ac_arg_profile="no") -AC_MSG_RESULT(${enable_profile-no}) - if test x$ac_arg_debug = xyes ; then TLDEBUG="-g -fno-inline" else Modified: trunk/jazz/configure.ac =================================================================== --- trunk/jazz/configure.ac 2008-10-08 03:23:28 UTC (rev 611) +++ trunk/jazz/configure.ac 2008-11-07 18:46:50 UTC (rev 612) @@ -72,6 +72,36 @@ fi AC_MSG_RESULT($result) +AC_MSG_CHECKING([whether to enable debugging]) +AC_ARG_ENABLE( + debug, + AC_HELP_STRING( + [--enable-debug], + [enable debugging code (off by default)]), + ac_arg_debug="$enableval", + ac_arg_debug="no") +AC_MSG_RESULT(${enable_debug-no}) + +AC_MSG_CHECKING([whether to enable optimization]) +AC_ARG_ENABLE( + optimize, + AC_HELP_STRING( + [--enable-optimize@<:@=ARG@:>@], + [enable optimized code with ARG = 0, 1, 2, or 3 (off by default ARG = 0)]), + [opt_level="$enableval" ac_arg_optimize="yes"], + ac_arg_optimize="no") +AC_MSG_RESULT(${enable_optimize-no}) + +AC_MSG_CHECKING([whether to enable profiling]) +AC_ARG_ENABLE( + profile, + AC_HELP_STRING( + [--enable-profile], + [enable gprof profiling code (off by default)]), + ac_arg_profile="$enableval", + ac_arg_profile="no") +AC_MSG_RESULT(${enable_profile-no}) + dnl To support a new system, you need to add its canonical name (as determined dnl by config.sub or specified by the configure command line) to this "case" dnl and also define the shared library flags below - search for @@ -113,7 +143,7 @@ AC_HELP_STRING( [--enable-sequencer2], [enable sequencer2 support (off by default)]), - ac_arg_profile="yes", + ac_arg_profile="$enableval", ac_arg_profile="no") AC_MSG_RESULT(${enable_sequencer2-no}) @@ -132,10 +162,14 @@ AC_DEFINE(DEV_MPU401,1,[support jazz's own driver over tcp/ip]) fi +if test x$ac_arg_debug = xyes ; then + wx_config_args=--debug +fi + dnl Check for wxWidgets AM_OPTIONS_WXCONFIG -AM_PATH_WXCONFIG(2.8.7, wxWin=1) +AM_PATH_WXCONFIG(2.8.9, wxWin=1) if test "$wxWin" != 1; then AC_MSG_ERROR([ @@ -146,7 +180,7 @@ directory where wxWidgets libraries are installed (returned by 'wx-config --libs' command) is in LD_LIBRARY_PATH or equivalent variable, and the - wxWidgets version is 2.8.7 or above. + wxWidgets version is 2.8.9 or above. ]) fi @@ -156,36 +190,6 @@ PORTMIDI_PATH=$JAZZ_PATH/portmidi AC_SUBST(PORTMIDI_PATH) -AC_MSG_CHECKING([whether to enable debugging]) -AC_ARG_ENABLE( - debug, - AC_HELP_STRING( - [--enable-debug], - [enable debugging code (off by default)]), - ac_arg_debug="yes", - ac_arg_debug="no") -AC_MSG_RESULT(${enable_debug-no}) - -AC_MSG_CHECKING([whether to enable optimization]) -AC_ARG_ENABLE( - optimize, - AC_HELP_STRING( - [--enable-optimize@<:@=ARG@:>@], - [enable optimized code with ARG = 0, 1, 2, or 3 (off by default ARG = 0)]), - [opt_level="$enableval" ac_arg_optimize="yes"], - ac_arg_optimize="no") -AC_MSG_RESULT(${enable_optimize-no}) - -AC_MSG_CHECKING([whether to enable profiling]) -AC_ARG_ENABLE( - profile, - AC_HELP_STRING( - [--enable-profile], - [enable gprof profiling code (off by default)]), - ac_arg_profile="yes", - ac_arg_profile="no") -AC_MSG_RESULT(${enable_profile-no}) - if test x$ac_arg_debug = xyes ; then TLDEBUG="-g -fno-inline" else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2008-12-27 02:14:12
|
Revision: 656 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=656&view=rev Author: pstieber Date: 2008-12-27 02:14:07 +0000 (Sat, 27 Dec 2008) Log Message: ----------- Removed the use of WxWidgets.h and the file itself. This will break the Linux build for a short time, but I'm going to start working on it soon. Now I'm only using the minimal amount of wxWidgets includes necessary in each file and trying to make sure the header files are self contained. Modified Paths: -------------- trunk/jazz/src/AboutDialog.cpp trunk/jazz/src/AboutDialog.h trunk/jazz/src/AlsaDriver.cpp trunk/jazz/src/AlsaPlayer.cpp trunk/jazz/src/AlsaThru.cpp trunk/jazz/src/AsciiMidiFile.cpp trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h trunk/jazz/src/AudioDriver.cpp trunk/jazz/src/ClockDialog.cpp trunk/jazz/src/Command.cpp trunk/jazz/src/Configuration.cpp trunk/jazz/src/Configuration.h trunk/jazz/src/ControlEdit.cpp trunk/jazz/src/ControlEdit.h trunk/jazz/src/Dialogs/KeyOnDialog.cpp trunk/jazz/src/Dialogs/KeyOnDialog.h trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.cpp trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.h trunk/jazz/src/Dialogs/TrackDialog.cpp trunk/jazz/src/Dialogs/TrackDialog.h trunk/jazz/src/Dialogs.cpp trunk/jazz/src/ErrorMessage.cpp trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/Events.cpp trunk/jazz/src/Events.h trunk/jazz/src/FileSelector.cpp trunk/jazz/src/Filter.cpp trunk/jazz/src/Filter.h trunk/jazz/src/FindFile.cpp trunk/jazz/src/GetOptionIndex.cpp trunk/jazz/src/Globals.cpp trunk/jazz/src/GuitarFrame.cpp trunk/jazz/src/GuitarFrame.h trunk/jazz/src/GuitarSettingsDialog.cpp trunk/jazz/src/GuitarSettingsDialog.h trunk/jazz/src/GuitarWindow.cpp trunk/jazz/src/GuitarWindow.h trunk/jazz/src/Harmony.cpp trunk/jazz/src/Harmony.h trunk/jazz/src/HarmonyBrowserAnalyzer.cpp trunk/jazz/src/Help.cpp trunk/jazz/src/Help.h trunk/jazz/src/JazzPlusPlusApplication.cpp trunk/jazz/src/JazzPlusPlusApplication.h trunk/jazz/src/KeyDialog.cpp trunk/jazz/src/Knob.cpp trunk/jazz/src/Knob.h trunk/jazz/src/MeasureChoice.cpp trunk/jazz/src/Metronome.cpp trunk/jazz/src/MidiDeviceDialog.cpp trunk/jazz/src/MidiDeviceDialog.h trunk/jazz/src/MouseAction.cpp trunk/jazz/src/NamedChoice.cpp trunk/jazz/src/NamedChoice.h trunk/jazz/src/NamedValue.cpp trunk/jazz/src/NamedValueChoice.cpp trunk/jazz/src/NamedValueChoice.h trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/PianoFrame.h trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/PianoWindow.h trunk/jazz/src/Player.cpp trunk/jazz/src/PortMidiPlayer.cpp trunk/jazz/src/Project.cpp trunk/jazz/src/ProjectManager.cpp trunk/jazz/src/PropertyListDialog.cpp trunk/jazz/src/Random.cpp trunk/jazz/src/Random.h trunk/jazz/src/Rectangle.cpp trunk/jazz/src/Rectangle.h trunk/jazz/src/ResourceDialog.cpp trunk/jazz/src/ResourceDialog.h trunk/jazz/src/Rhythm.cpp trunk/jazz/src/Rhythm.h trunk/jazz/src/Sample.cpp trunk/jazz/src/SampleCommand.cpp trunk/jazz/src/SampleDialog.cpp trunk/jazz/src/SampleDialog.h trunk/jazz/src/SampleWindow.cpp trunk/jazz/src/SampleWindow.h trunk/jazz/src/SelectControllerDialog.cpp trunk/jazz/src/Signal2.cpp trunk/jazz/src/SliderWindow.cpp trunk/jazz/src/SliderWindow.h trunk/jazz/src/Song.cpp trunk/jazz/src/StandardFile.cpp trunk/jazz/src/Synth.cpp trunk/jazz/src/ToolBar.cpp trunk/jazz/src/ToolBar.h trunk/jazz/src/Track.cpp trunk/jazz/src/Track.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/src/TrackFrame.h trunk/jazz/src/TrackWindow.cpp trunk/jazz/src/commands/copyCommand.cpp trunk/jazz/src/mswin/WindowsAudioInterface.cpp trunk/jazz/src/mswin/WindowsMidiInterface.cpp trunk/jazz/src/mswin/WindowsPlayer.cpp trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.sln trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Removed Paths: ------------- trunk/jazz/src/WxWidgets.h Modified: trunk/jazz/src/AboutDialog.cpp =================================================================== --- trunk/jazz/src/AboutDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/AboutDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,22 +20,23 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "AboutDialog.h" -#include <wx/version.h> -#include <wx/html/htmlwin.h> - +#include "JazzPlusPlusApplication.h" #include "Resources.h" -#include "AboutDialog.h" -#include "JazzPlusPlusApplication.h" +#include <wx/button.h> +#include <wx/html/htmlwin.h> +#include <wx/sizer.h> +#include <wx/statbmp.h> +#include <wx/version.h> -#include "Bitmaps/JazzLogo.xpm" - #include <sstream> using namespace std; +#include "Bitmaps/JazzLogo.xpm" + //***************************************************************************** // Description: // This is the Jazz++ application about dialog box definion. Modified: trunk/jazz/src/AboutDialog.h =================================================================== --- trunk/jazz/src/AboutDialog.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/AboutDialog.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,6 +23,11 @@ #ifndef JZ_ABOUTDIALOG_H #define JZ_ABOUTDIALOG_H +#include <wx/dialog.h> + +class wxBitmap; +class wxStaticBitmap; + //***************************************************************************** // Description: // This is the JAZZ++ about dialog declaration. Modified: trunk/jazz/src/AlsaDriver.cpp =================================================================== --- trunk/jazz/src/AlsaDriver.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/AlsaDriver.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -29,8 +29,6 @@ // Initial version: only playback is tested. //***************************************************************************** -#include "WxWidgets.h" - #include "AlsaDriver.h" #include "TrackFrame.h" Modified: trunk/jazz/src/AlsaPlayer.cpp =================================================================== --- trunk/jazz/src/AlsaPlayer.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/AlsaPlayer.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -29,15 +29,14 @@ // like OSS driver mode. //***************************************************************************** -#include "WxWidgets.h" - #include "AlsaPlayer.h" + +#include "Configuration.h" +#include "Dialogs.h" +#include "Globals.h" #include "ProjectManager.h" #include "TrackFrame.h" #include "TrackWindow.h" -#include "Dialogs.h" -#include "Configuration.h" -#include "Globals.h" #include <stdlib.h> #include <errno.h> Modified: trunk/jazz/src/AlsaThru.cpp =================================================================== --- trunk/jazz/src/AlsaThru.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/AlsaThru.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -35,20 +35,18 @@ // or a thread. //***************************************************************************** +#include "AlsaThru.h" -#include "WxWidgets.h" +#include "AlsaPlayer.h" -#include <stdlib.h> +#include <cstdlib> #include <errno.h> -#include <stdio.h> +#include <cstdio> #include <sys/wait.h> #include <unistd.h> #include <string.h> #include <signal.h> -#include "AlsaThru.h" -#include "AlsaPlayer.h" - /* ** midi thru for alsa. it creates a new process (because threads dont work ** with wxwin) that copies from input to output. Modified: trunk/jazz/src/AsciiMidiFile.cpp =================================================================== --- trunk/jazz/src/AsciiMidiFile.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/AsciiMidiFile.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -19,8 +19,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "AsciiMidiFile.h" //***************************************************************************** Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Audio.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,10 +20,9 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "Audio.h" #include "Sample.h" -#include "Audio.h" #include "Events.h" #include "RecordingInfo.h" #include "Track.h" @@ -39,12 +38,16 @@ #include "Help.h" #include "Resources.h" -#include <iostream> -#include <fstream> +#include <wx/listbox.h> +#include <wx/msgdlg.h> +#include <wx/slider.h> + +#include <cassert> #include <cmath> #include <cstdlib> +#include <fstream> +#include <iostream> -#include <assert.h> #include <sys/stat.h> #include <string.h> Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Audio.h 2008-12-27 02:14:07 UTC (rev 656) @@ -26,6 +26,9 @@ #include "DynamicArray.h" #include "Project.h" +#include <wx/app.h> +#include <wx/string.h> + class tEventArray; class JZTrack; struct tAudioBuffer; Modified: trunk/jazz/src/AudioDriver.cpp =================================================================== --- trunk/jazz/src/AudioDriver.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/AudioDriver.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,9 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "AudioDriver.h" + #include "RecordingInfo.h" #include "Configuration.h" #include "Globals.h" Modified: trunk/jazz/src/ClockDialog.cpp =================================================================== --- trunk/jazz/src/ClockDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/ClockDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,8 +20,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "ClockDialog.h" #include "Song.h" Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Command.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,14 +20,13 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "Command.h" + +#include "Filter.h" +#include "Globals.h" #include "Song.h" #include "Track.h" -#include "Filter.h" #include "Random.h" -#include "Globals.h" #include <cstdlib> #include <limits> Modified: trunk/jazz/src/Configuration.cpp =================================================================== --- trunk/jazz/src/Configuration.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Configuration.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,22 +20,21 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - -#include <wx/stdpaths.h> -#include <wx/filename.h> - #include "Configuration.h" -#include "Synth.h" #include "FindFile.h" #include "Globals.h" #include "StringUtilities.h" +#include "Synth.h" -#include <stack> +#include <wx/filename.h> +#include <wx/msgdlg.h> +#include <wx/stdpaths.h> + +#include <fstream> #include <iostream> #include <sstream> -#include <fstream> +#include <stack> using namespace std; Modified: trunk/jazz/src/Configuration.h =================================================================== --- trunk/jazz/src/Configuration.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Configuration.h 2008-12-27 02:14:07 UTC (rev 656) @@ -26,6 +26,8 @@ #include <string> #include <vector> +#include <wx/string.h> + //***************************************************************************** //***************************************************************************** class JZDoubleCommand Modified: trunk/jazz/src/ControlEdit.cpp =================================================================== --- trunk/jazz/src/ControlEdit.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/ControlEdit.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,14 +20,16 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "ControlEdit.h" -#include "ControlEdit.h" +#include "EventWindow.h" #include "PianoWindow.h" -#include "EventWindow.h" #include "Song.h" #include "Track.h" +#include <wx/button.h> +#include <wx/sizer.h> + static const long wbar = 2; static int bars_state = 2; // from ArrayEdit Modified: trunk/jazz/src/ControlEdit.h =================================================================== --- trunk/jazz/src/ControlEdit.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/ControlEdit.h 2008-12-27 02:14:07 UTC (rev 656) @@ -25,10 +25,13 @@ #include "Random.h" +#include <wx/panel.h> + class JZPianoWindow; class JZTrack; class JZEvent; class tCtrlEditBase; +class wxButton; // to access tCtrlEditBase from Buttons etc @@ -125,8 +128,8 @@ void Create(JZPianoWindow* p, char const *label, int dx, int x, int y, int w, int h); - static void Apply(wxButton &but, wxCommandEvent& event); - static void Revert(wxButton &but, wxCommandEvent& event); + static void Apply(wxButton& but, wxCommandEvent& event); + static void Revert(wxButton& but, wxCommandEvent& event); // SN++ static void Edit(wxButton &but, wxCommandEvent& event); static void Bars(wxButton &but, wxCommandEvent& event); Modified: trunk/jazz/src/Dialogs/KeyOnDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -18,17 +18,20 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "KeyOnDialog.h" +#include "../Events.h" #include "../Globals.h" +#include "../KeyStringConverters.h" +#include "../Knob.h" #include "../Project.h" -#include "../Events.h" -#include "../Knob.h" -#include "../KeyStringConverters.h" #include "../Resources.h" +#include <wx/button.h> +#include <wx/sizer.h> +#include <wx/stattext.h> +#include <wx/textctrl.h> + #include <sstream> using namespace std; Modified: trunk/jazz/src/Dialogs/KeyOnDialog.h =================================================================== --- trunk/jazz/src/Dialogs/KeyOnDialog.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Dialogs/KeyOnDialog.h 2008-12-27 02:14:07 UTC (rev 656) @@ -21,9 +21,13 @@ #ifndef JZ_KEYONDIALOG_H #define JZ_KEYONDIALOG_H +#include <wx/dialog.h> + +class JZKnob; +class JZKnobEvent; class tKeyOn; -class JZKnobEvent; -class JZKnob; +class wxStaticText; +class wxTextCtrl; //***************************************************************************** //***************************************************************************** Modified: trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Dialogs/MetronomeSettingsDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -18,16 +18,20 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "MetronomeSettingsDialog.h" -#include "../Metronome.h" #include "../Configuration.h" #include "../Globals.h" #include "../Knob.h" +#include "../Metronome.h" #include "../Resources.h" +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/listbox.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + #include <iostream> #include <sstream> Modified: trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h =================================================================== --- trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Dialogs/MetronomeSettingsDialog.h 2008-12-27 02:14:07 UTC (rev 656) @@ -21,14 +21,19 @@ #ifndef JZ_METRONOMESETTINGDIALOG_H #define JZ_METRONOMESETTINGDIALOG_H -class JZMetronomeInfo; +#include <wx/dialog.h> + +#include <map> +#include <string> +#include <vector> + class JZKnob; class JZKnobEvent; +class JZMetronomeInfo; +class wxCheckBox; +class wxListBox; +class wxStaticText; -#include <vector> -#include <string> -#include <map> - //***************************************************************************** //***************************************************************************** class JZMetronomeSettingsDialog : public wxDialog Modified: trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -18,12 +18,17 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "SynthesizerSettingsDialog.h" -#include "SynthesizerSettingsDialog.h" #include "../Configuration.h" #include "../Globals.h" +#include <wx/button.h> +#include <wx/listbox.h> +#include <wx/msgdlg.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + using namespace std; //***************************************************************************** Modified: trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Dialogs/SynthesizerSettingsDialog.h 2008-12-27 02:14:07 UTC (rev 656) @@ -21,8 +21,12 @@ #ifndef JZ_SYNTHESIZERSETTINGDIALOG_H #define JZ_SYNTHESIZERSETTINGDIALOG_H +#include <wx/dialog.h> + #include <string> +class wxListBox; + //***************************************************************************** //***************************************************************************** class JZSynthesizerDialog : public wxDialog Modified: trunk/jazz/src/Dialogs/TrackDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/TrackDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Dialogs/TrackDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -18,15 +18,20 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "TrackDialog.h" -#include "TrackDialog.h" -#include "../Knob.h" -#include "../Track.h" #include "../Configuration.h" #include "../Globals.h" +#include "../Knob.h" #include "../Resources.h" +#include "../Track.h" +#include <wx/button.h> +#include <wx/listbox.h> +#include <wx/sizer.h> +#include <wx/stattext.h> +#include <wx/textctrl.h> + #include <sstream> using namespace std; Modified: trunk/jazz/src/Dialogs/TrackDialog.h =================================================================== --- trunk/jazz/src/Dialogs/TrackDialog.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Dialogs/TrackDialog.h 2008-12-27 02:14:07 UTC (rev 656) @@ -21,11 +21,14 @@ #ifndef JZ_TRACKDIALOG_H #define JZ_TRACKDIALOG_H +#include <wx/dialog.h> + +class JZKnob; +class JZKnobEvent; class JZTrack; +class wxListBox; +class wxStaticText; class wxTextCtrl; -class wxStaticText; -class JZKnobEvent; -class JZKnob; //***************************************************************************** //***************************************************************************** Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Dialogs.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,31 +20,31 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "Dialogs.h" -#include "Dialogs.h" -#include "Song.h" -#include "Synth.h" +#include "ClockDialog.h" #include "Command.h" +#include "DeprecatedWx/proplist.h" +#include "Dialogs/KeyOnDialog.h" +#include "Events.h" #include "EventWindow.h" -#include "ProjectManager.h" -#include "Track.h" -#include "Events.h" -#include "Player.h" +#include "Globals.h" +#include "Help.h" +#include "KeyDialog.h" +#include "NamedChoice.h" #include "PianoFrame.h" #include "PianoWindow.h" -#include "ClockDialog.h" -#include "KeyDialog.h" +#include "Player.h" +#include "ProjectManager.h" #include "PropertyListDialog.h" -#include "Globals.h" -#include "NamedChoice.h" -#include "Help.h" -#include "DeprecatedWx/proplist.h" +#include "Song.h" +#include "Synth.h" +#include "Track.h" -#include "Dialogs/KeyOnDialog.h" +#include <wx/choicdlg.h> +#include <iomanip> #include <sstream> -#include <iomanip> using namespace std; Modified: trunk/jazz/src/ErrorMessage.cpp =================================================================== --- trunk/jazz/src/ErrorMessage.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/ErrorMessage.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,7 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include <wx/msgdlg.h> #include <string> Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/EventWindow.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,9 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "EventWindow.h" -#include "EventWindow.h" #include "PianoFrame.h" #include "Song.h" #include "Command.h" @@ -31,6 +30,10 @@ #include "ToolBar.h" #include "PropertyListDialog.h" +#include <wx/brush.h> +#include <wx/dc.h> +#include <wx/msgdlg.h> + using namespace std; //***************************************************************************** Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/EventWindow.h 2008-12-27 02:14:07 UTC (rev 656) @@ -26,6 +26,8 @@ #include "Filter.h" #include "MouseAction.h" +#include <wx/frame.h> + class JZEventFrame; class JZSong; class JZToolBar; Modified: trunk/jazz/src/Events.cpp =================================================================== --- trunk/jazz/src/Events.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Events.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,19 +20,17 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "Events.h" -#include "Synth.h" + +#include "ErrorMessage.h" #include "Globals.h" #include "JazzPlusPlusApplication.h" -#include "ErrorMessage.h" +#include "Synth.h" -#include <stdio.h> -#include <stdlib.h> -#include <assert.h> -#include <stdarg.h> - +#include <cassert> +#include <cstdarg> +#include <cstdio> +#include <cstdlib> #include <sstream> using namespace std; Modified: trunk/jazz/src/Events.h =================================================================== --- trunk/jazz/src/Events.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Events.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,10 +23,12 @@ #ifndef JZ_EVENTS_H #define JZ_EVENTS_H +#include <cstdio> + +#include <wx/pen.h> + class JZEvent; -#include <cstdio> - //***************************************************************************** // Output device, can be // - Midi-Standard-File Modified: trunk/jazz/src/FileSelector.cpp =================================================================== --- trunk/jazz/src/FileSelector.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/FileSelector.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,7 +20,9 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include <wx/filedlg.h> +#include <wx/msgdlg.h> +#include <wx/string.h> //***************************************************************************** // Description: Modified: trunk/jazz/src/Filter.cpp =================================================================== --- trunk/jazz/src/Filter.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Filter.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,15 +20,13 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - -#include "PropertyListDialog.h" - #include "Filter.h" -#include "Events.h" + #include "ClockDialog.h" -#include "Song.h" +#include "Events.h" #include "Help.h" +#include "PropertyListDialog.h" +#include "Song.h" #include <cstdlib> @@ -191,12 +189,12 @@ void JZFilter::Dialog(wxFrame *parent, int ShowEventStats) { tFilterDlg *dlg; - // DialogBox = new wxDialogBox(parent, "Event Filter", FALSE ); + // mpDialogBox = new wxDialogBox(parent, "Event Filter", FALSE ); dlg = new tFilterDlg(this, mpSong, ShowEventStats); dlg->Create(); -// dlg->EditForm(DialogBox, ShowEventStats); -// DialogBox->Fit(); -// DialogBox->Show(TRUE); +// dlg->EditForm(mpDialogBox, ShowEventStats); +// mpDialogBox->Fit(); +// mpDialogBox->Show(TRUE); } Modified: trunk/jazz/src/Filter.h =================================================================== --- trunk/jazz/src/Filter.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Filter.h 2008-12-27 02:14:07 UTC (rev 656) @@ -27,8 +27,9 @@ class JZSong; class JZTrack; +class wxDialog; +class wxFrame; - #define FltKeyOn 0 #define FltKeyPressure 1 // SN++ PolyAftertouch gehoert to KeyOn Events! #define FltControl 2 @@ -57,7 +58,7 @@ class JZFilter : public wxObject { friend class tFilterDlg; - wxDialog* DialogBox; + wxDialog* mpDialogBox; void copy(const JZFilter& Other); public: @@ -71,7 +72,7 @@ int FromTrack, ToTrack; // 1..n einschl .. einschl - void Dialog(wxFrame *parent, int ShowEventStats = 1); + void Dialog(wxFrame* parent, int ShowEventStats = 1); JZFilter(JZSong* pSong); JZFilter(JZFilter* pOtherFilter); Modified: trunk/jazz/src/FindFile.cpp =================================================================== --- trunk/jazz/src/FindFile.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/FindFile.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,7 +20,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include <wx/app.h> #include <wx/filename.h> #include <iostream> Modified: trunk/jazz/src/GetOptionIndex.cpp =================================================================== --- trunk/jazz/src/GetOptionIndex.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/GetOptionIndex.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -1,5 +1,3 @@ -#include "WxWidgets.h" - #include "JazzPlusPlusApplication.h" int GetOptionIndex(const wxString& Option) Modified: trunk/jazz/src/Globals.cpp =================================================================== --- trunk/jazz/src/Globals.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Globals.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,14 +20,14 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" #include "Globals.h" -#include "Song.h" -#include "Synth.h" -#include "Player.h" + #include "Help.h" #include "NamedValue.h" +#include "Player.h" #include "Project.h" +#include "Song.h" +#include "Synth.h" using namespace std; Modified: trunk/jazz/src/GuitarFrame.cpp =================================================================== --- trunk/jazz/src/GuitarFrame.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/GuitarFrame.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,15 +20,15 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "GuitarFrame.h" -#include "Resources.h" - -#include "GuitarFrame.h" #include "GuitarWindow.h" #include "GuitarSettingsDialog.h" #include "ProjectManager.h" +#include "Resources.h" +#include <wx/menu.h> + //***************************************************************************** // Description: // This is the guitar frame class definition. Modified: trunk/jazz/src/GuitarFrame.h =================================================================== --- trunk/jazz/src/GuitarFrame.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/GuitarFrame.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,6 +23,8 @@ #ifndef JZ_GUITARFRAME_H #define JZ_GUITARFRAME_H +#include <wx/frame.h> + class JZGuitarWindow; //***************************************************************************** Modified: trunk/jazz/src/GuitarSettingsDialog.cpp =================================================================== --- trunk/jazz/src/GuitarSettingsDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/GuitarSettingsDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,10 +20,12 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "GuitarSettingsDialog.h" +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/sizer.h> + //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- BEGIN_EVENT_TABLE(JZGuitarSettingsDialog, wxDialog) Modified: trunk/jazz/src/GuitarSettingsDialog.h =================================================================== --- trunk/jazz/src/GuitarSettingsDialog.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/GuitarSettingsDialog.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,6 +23,10 @@ #ifndef JZ_GUITARSETTINGSDIALOG_H #define JZ_GUITARSETTINGSDIALOG_H +#include <wx/dialog.h> + +class wxCheckBox; + class JZGuitarSettingsDialog : public wxDialog { public: Modified: trunk/jazz/src/GuitarWindow.cpp =================================================================== --- trunk/jazz/src/GuitarWindow.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/GuitarWindow.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,11 +20,12 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "GuitarWindow.h" -#include "GuitarWindow.h" #include "GuitarFrame.h" +#include <wx/dcclient.h> + #include <string> using namespace std; Modified: trunk/jazz/src/GuitarWindow.h =================================================================== --- trunk/jazz/src/GuitarWindow.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/GuitarWindow.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,6 +23,8 @@ #ifndef JZ_GUITARWINDOW_H #define JZ_GUITARWINDOW_H +#include <wx/scrolwin.h> + class JZGuitarFrame; //***************************************************************************** Modified: trunk/jazz/src/Harmony.cpp =================================================================== --- trunk/jazz/src/Harmony.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Harmony.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,9 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "Harmony.h" -#include "Harmony.h" #include "HarmonyP.h" #include "ProjectManager.h" #include "Player.h" @@ -40,6 +39,16 @@ #include "Globals.h" #include "Help.h" +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/dcclient.h> +#include <wx/listbox.h> +#include <wx/menu.h> +#include <wx/msgdlg.h> +#include <wx/scrolwin.h> +#include <wx/stattext.h> +#include <wx/toolbar.h> + #include <iostream> #include <fstream> @@ -1612,12 +1621,12 @@ private: - HBCanvas* mpHbWindow; - wxCheckBox *chord_chk[12]; - wxCheckBox *scale_chk[12]; - wxListBox *chord_lst; - wxListBox *scale_lst; - wxStaticText *chord_msg; + HBCanvas* mpHbWindow; + wxCheckBox* chord_chk[12]; + wxCheckBox* scale_chk[12]; + wxListBox* chord_lst; + wxListBox* scale_lst; + wxStaticText* chord_msg; wxButton *ok_but; wxButton *cancel_but; Modified: trunk/jazz/src/Harmony.h =================================================================== --- trunk/jazz/src/Harmony.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Harmony.h 2008-12-27 02:14:07 UTC (rev 656) @@ -25,6 +25,8 @@ #include "ToolBar.h" +#include <wx/frame.h> + class wxObject; class HBAnalyzer; class HBCanvas; Modified: trunk/jazz/src/HarmonyBrowserAnalyzer.cpp =================================================================== --- trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,9 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "HarmonyBrowserAnalyzer.h" + #include "EventWindow.h" #include "Command.h" #include "HarmonyP.h" Modified: trunk/jazz/src/Help.cpp =================================================================== --- trunk/jazz/src/Help.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Help.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,13 +20,10 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - -#include "wx/html/helpctrl.h" - #include "Help.h" -#include "Globals.h" +#include <wx/html/helpctrl.h> + #include <iostream> using namespace std; Modified: trunk/jazz/src/Help.h =================================================================== --- trunk/jazz/src/Help.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Help.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,6 +23,8 @@ #ifndef JZ_HELP_H #define JZ_HELP_H +#include <wx/string.h> + class wxHtmlHelpController; //***************************************************************************** Modified: trunk/jazz/src/JazzPlusPlusApplication.cpp =================================================================== --- trunk/jazz/src/JazzPlusPlusApplication.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/JazzPlusPlusApplication.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,16 +20,12 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "JazzPlusPlusApplication.h" -#include <wx/stdpaths.h> -#include <wx/fileconf.h> - -#include "JazzPlusPlusApplication.h" -#include "TrackFrame.h" +#include "Globals.h" #include "Project.h" #include "ProjectManager.h" -#include "Globals.h" +#include "TrackFrame.h" #ifdef _MSC_VER @@ -51,6 +47,12 @@ #endif +#include <wx/stdpaths.h> +#include <wx/fileconf.h> +#include <wx/filedlg.h> +#include <wx/image.h> +#include <wx/msgdlg.h> + #include <fstream> #include <vector> Modified: trunk/jazz/src/JazzPlusPlusApplication.h =================================================================== --- trunk/jazz/src/JazzPlusPlusApplication.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/JazzPlusPlusApplication.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,6 +23,7 @@ #ifndef JZ_JAZZPLUSPLUSAPPLICATION_H #define JZ_JAZZPLUSPLUSAPPLICATION_H +#include <wx/app.h> #include <wx/html/helpctrl.h> class JZProject; Modified: trunk/jazz/src/KeyDialog.cpp =================================================================== --- trunk/jazz/src/KeyDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/KeyDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,9 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "KeyDialog.h" + #include "KeyStringConverters.h" #include "DeprecatedStringUtils.h" #include "DeprecatedWx/proplist.h" Modified: trunk/jazz/src/Knob.cpp =================================================================== --- trunk/jazz/src/Knob.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Knob.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -18,13 +18,13 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "Knob.h" +#include "Globals.h" + #include <wx/dcbuffer.h> +#include <wx/settings.h> -#include "Knob.h" -#include "Globals.h" - #include <cmath> //***************************************************************************** Modified: trunk/jazz/src/Knob.h =================================================================== --- trunk/jazz/src/Knob.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Knob.h 2008-12-27 02:14:07 UTC (rev 656) @@ -21,6 +21,9 @@ #ifndef JZ_KNOB_H #define JZ_KNOB_H +#include <wx/bitmap.h> +#include <wx/control.h> + class JZKnobEvent; class JZKnob; Modified: trunk/jazz/src/MeasureChoice.cpp =================================================================== --- trunk/jazz/src/MeasureChoice.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/MeasureChoice.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,9 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "MeasureChoice.h" + #include "Song.h" #include "Globals.h" Modified: trunk/jazz/src/Metronome.cpp =================================================================== --- trunk/jazz/src/Metronome.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Metronome.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,9 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "Metronome.h" + #include "Configuration.h" #include "Globals.h" #include "Events.h" Modified: trunk/jazz/src/MidiDeviceDialog.cpp =================================================================== --- trunk/jazz/src/MidiDeviceDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/MidiDeviceDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,10 +20,12 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "MidiDeviceDialog.h" +#include <wx/button.h> +#include <wx/listbox.h> +#include <wx/sizer.h> + using namespace std; //***************************************************************************** Modified: trunk/jazz/src/MidiDeviceDialog.h =================================================================== --- trunk/jazz/src/MidiDeviceDialog.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/MidiDeviceDialog.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,9 +23,13 @@ #ifndef JZ_MIDIDEVICEDIALOG_H #define JZ_MIDIDEVICEDIALOG_H +#include <wx/dialog.h> + #include <vector> #include <string> +class wxListBox; + //***************************************************************************** // Description: // This is the MIDI device selection dialog class declaration. Modified: trunk/jazz/src/MouseAction.cpp =================================================================== --- trunk/jazz/src/MouseAction.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/MouseAction.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,11 +20,13 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "MouseAction.h" -#include "MouseAction.h" #include "EventWindow.h" +#include <wx/dcclient.h> +#include <wx/brush.h> + using namespace std; // ----------------------------------------------------------------- Modified: trunk/jazz/src/NamedChoice.cpp =================================================================== --- trunk/jazz/src/NamedChoice.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/NamedChoice.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,9 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "NamedChoice.h" + #include "NamedValue.h" #include "DeprecatedStringUtils.h" #include "DeprecatedWx/proplist.h" Modified: trunk/jazz/src/NamedChoice.h =================================================================== --- trunk/jazz/src/NamedChoice.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/NamedChoice.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,6 +23,8 @@ #ifndef JZ_NAMEDCHOICE_H #define JZ_NAMEDCHOICE_H +#include <wx/object.h> + #include <vector> #include <string> Modified: trunk/jazz/src/NamedValue.cpp =================================================================== --- trunk/jazz/src/NamedValue.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/NamedValue.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,8 +20,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "NamedValue.h" using namespace std; Modified: trunk/jazz/src/NamedValueChoice.cpp =================================================================== --- trunk/jazz/src/NamedValueChoice.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/NamedValueChoice.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,8 +20,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "NamedValueChoice.h" using namespace std; Modified: trunk/jazz/src/NamedValueChoice.h =================================================================== --- trunk/jazz/src/NamedValueChoice.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/NamedValueChoice.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,6 +23,8 @@ #ifndef JZ_NAMEDVALUECHOICE_H #define JZ_NAMEDVALUECHOICE_H +#include <wx/choice.h> + #include <vector> #include <string> Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/PianoFrame.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,29 +20,30 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "PianoFrame.h" -#include "Resources.h" - -#include "PianoFrame.h" +#include "Command.h" +#include "ControlEdit.h" +#include "Dialogs.h" +#include "Globals.h" +#include "Harmony.h" #include "PianoWindow.h" #include "ProjectManager.h" +#include "Resources.h" #include "Song.h" #include "Track.h" #include "Synth.h" #include "StandardFile.h" -#include "Dialogs.h" -#include "Harmony.h" -#include "Command.h" -#include "Globals.h" #include "Player.h" -#include "ControlEdit.h" #include "GuitarFrame.h" #include "ToolBar.h" #include "ResourceDialog.h" #include "Help.h" #include "Rectangle.h" +#include <wx/menu.h> +#include <wx/msgdlg.h> + #include <sstream> using namespace std; @@ -243,7 +244,7 @@ // CreateMenu(); - DialogBox = 0; + mpDialogBox = 0; MixerForm = 0; CreateMenu(); Modified: trunk/jazz/src/PianoFrame.h =================================================================== --- trunk/jazz/src/PianoFrame.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/PianoFrame.h 2008-12-27 02:14:07 UTC (rev 656) @@ -26,6 +26,8 @@ #include "MouseAction.h" #include "Song.h" +#include <wx/frame.h> + class JZGuitarFrame; class JZSong; class JZToolBar; @@ -132,7 +134,7 @@ int mClockTicsPerPixel; JZSong* mpSong; - wxDialog* DialogBox; + wxDialog* mpDialogBox; wxDialog* MixerForm; private: Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/PianoWindow.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,28 +20,30 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "PianoWindow.h" -#include "Resources.h" - -#include "PianoWindow.h" -#include "PianoFrame.h" -#include "ProjectManager.h" +#include "Command.h" #include "ControlEdit.h" -#include "Song.h" +#include "Dialogs.h" #include "Filter.h" +#include "GuitarFrame.h" +#include "Harmony.h" +#include "HarmonyBrowserAnalyzer.h" #include "HarmonyP.h" -#include "HarmonyBrowserAnalyzer.h" -#include "Harmony.h" +#include "Help.h" +#include "PianoFrame.h" #include "Player.h" +#include "ProjectManager.h" +#include "ResourceDialog.h" +#include "Resources.h" +#include "SelectControllerDialog.h" +#include "Song.h" #include "Synth.h" -#include "Command.h" -#include "GuitarFrame.h" -#include "Dialogs.h" -#include "SelectControllerDialog.h" -#include "ResourceDialog.h" -#include "Help.h" +#include <wx/dcclient.h> +#include <wx/dcmemory.h> +#include <wx/msgdlg.h> + #include <sstream> using namespace std; Modified: trunk/jazz/src/PianoWindow.h =================================================================== --- trunk/jazz/src/PianoWindow.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/PianoWindow.h 2008-12-27 02:14:07 UTC (rev 656) @@ -28,6 +28,8 @@ #include "Track.h" #include "Globals.h" +#include <wx/brush.h> + class JZPianoFrame; class JZSong; class JZTrack; Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Player.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,9 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "Player.h" -#include "Player.h" #include "ProjectManager.h" #include "Synth.h" #include "TrackFrame.h" @@ -32,10 +31,12 @@ #include "Audio.h" #include "Globals.h" +#include <wx/msgdlg.h> + //#include <unistd.h> +#include <cassert> #include <cstdlib> -#include <assert.h> #include <string.h> #include <errno.h> Modified: trunk/jazz/src/PortMidiPlayer.cpp =================================================================== --- trunk/jazz/src/PortMidiPlayer.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/PortMidiPlayer.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -1,6 +1,5 @@ -#include "WxWidgets.h" - #include "PortMidiPlayer.h" + #include "JazzPlusPlusApplication.h" #include "TrackFrame.h" #include "TrackWindow.h" Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Project.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,22 +20,16 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "Project.h" -#include <wx/stdpaths.h> -#include <wx/config.h> -#include <wx/filename.h> -#include <wx/file.h> - -#include "Project.h" +#include "Filter.h" +#include "GetOptionIndex.h" +#include "Globals.h" +#include "Player.h" #include "RecordingInfo.h" #include "Synth.h" #include "Song.h" -#include "Globals.h" -#include "Filter.h" -#include "Player.h" #include "StandardFile.h" -#include "GetOptionIndex.h" #ifdef __WXMSW__ #include "WindowsPlayer.h" @@ -51,6 +45,12 @@ #include "AlsaDriver.h" #endif +#include <wx/stdpaths.h> +#include <wx/config.h> +#include <wx/file.h> +#include <wx/filedlg.h> +#include <wx/filename.h> + #include <fstream> #include <iostream> Modified: trunk/jazz/src/ProjectManager.cpp =================================================================== --- trunk/jazz/src/ProjectManager.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/ProjectManager.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -1,5 +1,3 @@ -#include "WxWidgets.h" - #include "ProjectManager.h" #include "PianoFrame.h" Modified: trunk/jazz/src/PropertyListDialog.cpp =================================================================== --- trunk/jazz/src/PropertyListDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/PropertyListDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,8 +20,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "PropertyListDialog.h" #include <cstdlib> Modified: trunk/jazz/src/Random.cpp =================================================================== --- trunk/jazz/src/Random.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Random.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,15 +20,15 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - -//#include "config.h" - #include "Random.h" #include "Mapper.h" -#include <assert.h> +#include <wx/dcclient.h> +#include <wx/frame.h> +#include <wx/scrolwin.h> + +#include <cassert> #include <cstdlib> using namespace std; @@ -261,7 +261,7 @@ #define TICK_LINE 0 tArrayEdit::tArrayEdit(wxFrame *frame, JZRndArray &ar, int xx, int yy, int ww, int hh, int sty) - : wxScrolledWindow(frame,-1, wxPoint(xx, yy), wxSize(ww, hh)), + : wxScrolledWindow(frame, wxID_ANY, wxPoint(xx, yy), wxSize(ww, hh)), mArray(ar), n(ar.n), min(ar.min), Modified: trunk/jazz/src/Random.h =================================================================== --- trunk/jazz/src/Random.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Random.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,6 +23,8 @@ #ifndef JZ_RANDOM_H #define JZ_RANDOM_H +#include <wx/scrolwin.h> + #include <iostream> #include "DynamicArray.h" Modified: trunk/jazz/src/Rectangle.cpp =================================================================== --- trunk/jazz/src/Rectangle.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Rectangle.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,8 +20,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "Rectangle.h" //***************************************************************************** Modified: trunk/jazz/src/Rectangle.h =================================================================== --- trunk/jazz/src/Rectangle.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Rectangle.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,6 +23,8 @@ #ifndef JZ_RECTANGLE_H #define JZ_RECTANGLE_H +#include <wx/gdicmn.h> + //***************************************************************************** // Description: // This is the Jazz++ rectangle class delcaration. Modified: trunk/jazz/src/ResourceDialog.cpp =================================================================== --- trunk/jazz/src/ResourceDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/ResourceDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -16,14 +16,17 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "WxWidgets.h" +#include "ResourceDialog.h" +#include <wx/checkbox.h> +#include <wx/choice.h> +#include <wx/dialog.h> #include <wx/fs_zip.h> +#include <wx/msgdlg.h> +#include <wx/slider.h> +#include <wx/textctrl.h> #include <wx/xrc/xmlres.h> -#include "ResourceDialog.h" - -#include <wx/listimpl.cpp> //WX_DEFINE_LIST(jppResourceElementList); using namespace std; Modified: trunk/jazz/src/ResourceDialog.h =================================================================== --- trunk/jazz/src/ResourceDialog.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/ResourceDialog.h 2008-12-27 02:14:07 UTC (rev 656) @@ -25,6 +25,12 @@ #include <list> +#include <wx/dynarray.h> +#include <wx/string.h> + +class wxDialog; +class wxWindow; + /// Used by jppResourceDialog to store "Attach" entries. /** This class links together a named resource and a pointer to a data item. @@ -225,7 +231,7 @@ std::list<jppResourceElement*> links; /// Reference to the dialog created from the XRC resource. - wxDialog *dialog; + wxDialog* dialog; /// The name of the dialog resource. Used in error reporting. wxString dialogName; Modified: trunk/jazz/src/Rhythm.cpp =================================================================== --- trunk/jazz/src/Rhythm.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Rhythm.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,9 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "Rhythm.h" -#include "Rhythm.h" #include "EventWindow.h" #include "Song.h" #include "Command.h" @@ -38,6 +37,14 @@ #include "SelectControllerDialog.h" #include "Help.h" +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/choicdlg.h> +#include <wx/listbox.h> +#include <wx/msgdlg.h> +#include <wx/slider.h> +#include <wx/toolbar.h> + #include <fstream> #include <sstream> Modified: trunk/jazz/src/Rhythm.h =================================================================== --- trunk/jazz/src/Rhythm.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Rhythm.h 2008-12-27 02:14:07 UTC (rev 656) @@ -27,12 +27,18 @@ #include "ToolBar.h" +#include <wx/frame.h> + #include <iostream> class JZTrack; class JZEventWindow; class JZSong; class JZBarInfo; +class wxButton; +class wxCheckBox; +class wxListBox; +class wxPanel; #define MAX_GROUPS 5 #define MAX_KEYS 20 Modified: trunk/jazz/src/Sample.cpp =================================================================== --- trunk/jazz/src/Sample.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/Sample.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,9 +20,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - #include "Sample.h" + #include "Audio.h" #include "Random.h" #include "SampleCommand.h" Modified: trunk/jazz/src/SampleCommand.cpp =================================================================== --- trunk/jazz/src/SampleCommand.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/SampleCommand.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,13 +20,12 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" - -#include "Sample.h" #include "SampleCommand.h" + #include "Audio.h" -#include "SignalInterface.h" #include "Mapper.h" +#include "Sample.h" +#include "SignalInterface.h" //#include "util.h" #include <cmath> Modified: trunk/jazz/src/SampleDialog.cpp =================================================================== --- trunk/jazz/src/SampleDialog.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/SampleDialog.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,13 +20,10 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "SampleDialog.h" -//#include "config.h" -#include "SampleDialog.h" #include "Sample.h" #include "SampleWindow.h" -//#include "jazz.h" #include "Mapper.h" #include "Audio.h" #include "SignalInterface.h" @@ -36,6 +33,12 @@ #include "DeprecatedStringUtils.h" #include "Help.h" +#include <wx/checkbox.h> +#include <wx/choice.h> +#include <wx/msgdlg.h> +#include <wx/slider.h> +#include <wx/statbox.h> + #include <fstream> #include <cmath> Modified: trunk/jazz/src/SampleDialog.h =================================================================== --- trunk/jazz/src/SampleDialog.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/SampleDialog.h 2008-12-27 02:14:07 UTC (rev 656) @@ -28,9 +28,13 @@ #include "SampleCommand.h" #include "PropertyListDialog.h" +class tPaintableCommand; class tSampleWin; class tSigEqualizer; -class tPaintableCommand; +class wxButton; +class wxCheckBox; +class wxChoice; +class wxSlider; /** * controls a tPaintableCommand, that is shows the parameter arrays Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/SampleWindow.cpp 2008-12-27 02:14:07 UTC (rev 656) @@ -20,24 +20,28 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#include "WxWidgets.h" +#include "SampleWindow.h" -#include "SampleWindow.h" -#include "SampleCommand.h" -#include "SampleDialog.h" -#include "ToolBar.h" -#include "Sample.h" #include "Audio.h" +#include "FileSelector.h" +#include "Globals.h" +#include "Help.h" +#include "Mapper.h" #include "MouseAction.h" -#include "Song.h" #include "Player.h" #include "Rhythm.h" +#include "Sample.h" +#include "SampleCommand.h" +#include "SampleDialog.h" +#include "Song.h" #include "SliderWindow.h" -#include "Mapper.h" -#include "FileSelector.h" -#include "Globals.h" -#include "Help.h" +#include "ToolBar.h" +#include <wx/dcclient.h> +#include <wx/menu.h> +#include <wx/msgdlg.h> +#include <wx/scrolbar.h> + #include <iostream> #define MEN_LOAD 1 Modified: trunk/jazz/src/SampleWindow.h =================================================================== --- trunk/jazz/src/SampleWindow.h 2008-12-27 02:03:27 UTC (rev 655) +++ trunk/jazz/src/SampleWindow.h 2008-12-27 02:14:07 UTC (rev 656) @@ -23,19 +23,22 @@ #ifndef samplwin_h #define samplwin_h -class tSample; -class tSampleCnvs; +#include "SampleCommand.h" + +#in... [truncated message content] |
From: <pst...@us...> - 2009-01-01 06:21:04
|
Revision: 678 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=678&view=rev Author: pstieber Date: 2009-01-01 06:20:59 +0000 (Thu, 01 Jan 2009) Log Message: ----------- Removed the unused KeyDialog code. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Makefile.am trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Removed Paths: ------------- trunk/jazz/src/KeyDialog.cpp trunk/jazz/src/KeyDialog.h Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-01-01 04:22:58 UTC (rev 677) +++ trunk/jazz/src/Dialogs.cpp 2009-01-01 06:20:59 UTC (rev 678) @@ -30,7 +30,6 @@ #include "EventWindow.h" #include "Globals.h" #include "Help.h" -#include "KeyDialog.h" #include "NamedChoice.h" #include "PianoFrame.h" #include "PianoWindow.h" @@ -88,8 +87,16 @@ void tShiftDlg::AddProperties() { //send wxPropertyValue REFERENCE not POINTER - sheet->AddProperty(new wxProperty("Snaps", wxPropertyValue(&mSteps), "integer", new wxIntegerListValidator(-16, 16))); - sheet->AddProperty(new wxProperty("clocks per snap", (long)mUnit, "integer"));//informational only + sheet->AddProperty(new wxProperty( + "Snaps", + wxPropertyValue(&mSteps), + "integer", + new wxIntegerListValidator(-16, 16))); + + sheet->AddProperty(new wxProperty( + "clocks per snap", + (long)mUnit, + "integer")); // informational only } Deleted: trunk/jazz/src/KeyDialog.cpp =================================================================== --- trunk/jazz/src/KeyDialog.cpp 2009-01-01 04:22:58 UTC (rev 677) +++ trunk/jazz/src/KeyDialog.cpp 2009-01-01 06:20:59 UTC (rev 678) @@ -1,60 +0,0 @@ -//***************************************************************************** -// The JAZZ++ Midi Sequencer -// -// Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. -// Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -//***************************************************************************** - -#include "KeyDialog.h" - -#include "KeyStringConverters.h" -#include "DeprecatedStringUtils.h" -#include "DeprecatedWx/proplist.h" - -using namespace std; - -JZKeyDialog::JZKeyDialog(const char* pTitle, int Key) -{ - string KeyString; - KeyToString(Key, KeyString); - mpString = copystring(KeyString.c_str()); - mpTitle = pTitle; -} - - -JZKeyDialog::~JZKeyDialog() -{ - delete mpString; -} - -#ifdef OBSOLETE -wxFormItem *JZKeyDialog::mkFormItem(int w) -{ - return wxMakeFormString(mpTitle, &mpString, wxFORM_DEFAULT, 0, 0, 0, w); -} -#endif - -wxProperty* JZKeyDialog::mkProperty() -{ - return new wxProperty(mpTitle, wxPropertyValue((char**)&mpString), "string"); -} - -int JZKeyDialog::GetKey() -{ - return StringToKey(mpString); -} Deleted: trunk/jazz/src/KeyDialog.h =================================================================== --- trunk/jazz/src/KeyDialog.h 2009-01-01 04:22:58 UTC (rev 677) +++ trunk/jazz/src/KeyDialog.h 2009-01-01 06:20:59 UTC (rev 678) @@ -1,51 +0,0 @@ -//***************************************************************************** -// The JAZZ++ Midi Sequencer -// -// Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. -// Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -//***************************************************************************** - -#ifndef JZ_KEYDIALOG_H -#define JZ_KEYDIALOG_H - -class wxProperty; - -//***************************************************************************** -//***************************************************************************** -class JZKeyDialog -{ - public: - - JZKeyDialog(const char* pTitle, int Key); - - ~JZKeyDialog(); - - //wxFormItem *mkFormItem(int w); - - wxProperty* mkProperty(); - - int GetKey(); - - private: - - char* mpString; - - const char* mpTitle; -}; - -#endif // !defined(JZ_KEYDIALOG_H) Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-01-01 04:22:58 UTC (rev 677) +++ trunk/jazz/src/Makefile.am 2009-01-01 06:20:59 UTC (rev 678) @@ -48,7 +48,6 @@ HarmonyP.cpp \ Help.cpp \ JazzPlusPlusApplication.cpp \ -KeyDialog.cpp \ KeyStringConverters.cpp \ Knob.cpp \ Mapper.cpp \ @@ -127,7 +126,6 @@ HarmonyP.cpp \ Help.cpp \ JazzPlusPlusApplication.cpp \ -KeyDialog.cpp \ KeyStringConverters.cpp \ Knob.cpp \ Mapper.cpp \ @@ -211,7 +209,6 @@ HarmonyP.h \ Help.h \ JazzPlusPlusApplication.h \ -KeyDialog.h \ KeyStringConverters.h \ Mapper.h \ MeasureChoice.h \ Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-01-01 04:22:58 UTC (rev 677) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-01-01 06:20:59 UTC (rev 678) @@ -446,14 +446,6 @@ > </File> <File - RelativePath="..\src\KeyDialog.cpp" - > - </File> - <File - RelativePath="..\src\KeyDialog.h" - > - </File> - <File RelativePath="..\src\KeyStringConverters.cpp" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-01-01 04:22:58 UTC (rev 677) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-01-01 06:20:59 UTC (rev 678) @@ -445,14 +445,6 @@ > </File> <File - RelativePath="..\src\KeyDialog.cpp" - > - </File> - <File - RelativePath="..\src\KeyDialog.h" - > - </File> - <File RelativePath="..\src\KeyStringConverters.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-01-02 18:37:54
|
Revision: 680 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=680&view=rev Author: pstieber Date: 2009-01-02 18:37:48 +0000 (Fri, 02 Jan 2009) Log Message: ----------- 1. Separated the event frame and event window code into separate source modules. Modified some includes in various file to handle this change. 2. Started implementing the shift dialog using a more modern wxWidgets approach. This is a WIP. 3. Modified Paths: -------------- trunk/jazz/src/ControlEdit.cpp trunk/jazz/src/Dialogs.cpp trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/HarmonyBrowserAnalyzer.cpp trunk/jazz/src/Makefile.am trunk/jazz/src/Rhythm.cpp trunk/jazz/src/TrackFrame.cpp trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/ShiftDialog.cpp trunk/jazz/src/Dialogs/ShiftDialog.h trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventFrame.h Modified: trunk/jazz/src/ControlEdit.cpp =================================================================== --- trunk/jazz/src/ControlEdit.cpp 2009-01-01 08:46:37 UTC (rev 679) +++ trunk/jazz/src/ControlEdit.cpp 2009-01-02 18:37:48 UTC (rev 680) @@ -23,6 +23,7 @@ #include "ControlEdit.h" #include "EventWindow.h" +#include "Filter.h" #include "PianoWindow.h" #include "Song.h" #include "Track.h" Added: trunk/jazz/src/Dialogs/ShiftDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/ShiftDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/ShiftDialog.cpp 2009-01-02 18:37:48 UTC (rev 680) @@ -0,0 +1,540 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "ShiftDialog.h" + +#include "../Filter.h" +#include "IntegerEdit.h" + +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/msgdlg.h> +#include <wx/sizer.h> +#include <wx/stattext.h> +#include <wx/textctrl.h> + +#include <string> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZShiftDialog, wxDialog) + + EVT_BUTTON(wxID_HELP, JZShiftDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZShiftDialog::JZShiftDialog( + JZEventFrame& EventWindow, + JZFilter& Filter, + wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Shift")), + mFilter(Filter), + mpFromTimeEdit(0), + mpToTimeEdit(0), + mpFromTrackEdit(0), + mpToTrackEdit(0), + mpNoteCheckBox(0), + mpNoteMinEdit(0), + mpNoteMaxEdit(0), + mpPolyAftertouchCheckBox(0), + mpPolyAftertouchMinEdit(0), + mpPolyAftertouchMaxEdit(0), + mpControllerCheckBox(0), + mpControllerMinEdit(0), + mpControllerMaxEdit(0), + mpPatchCheckBox(0), + mpPatchMinEdit(0), + mpPatchMaxEdit(0), + mpPitchCheckBox(0), + mpPitchMinEdit(0), + mpPitchMaxEdit(0), + mpMeterCheckBox(0), + mpChannelAftertouchCheckBox(0), + mpSysExCheckBox(0), + mpOtherBox(0) +{ + mpFromTimeEdit = new wxTextCtrl(this, wxID_ANY); + mpToTimeEdit = new wxTextCtrl(this, wxID_ANY); + + mpFromTrackEdit = new JZIntegerEdit(this, wxID_ANY); + mpFromTrackEdit->SetValueName("FromTrack"); + mpFromTrackEdit->SetMinAndMax(1, 127); + mpToTrackEdit = new JZIntegerEdit(this, wxID_ANY); + mpToTrackEdit->SetValueName("To Track"); + mpToTrackEdit->SetMinAndMax(1, 127); + + mpNoteCheckBox = new wxCheckBox(this, wxID_ANY, "Note"); + mpNoteMinEdit = new JZIntegerEdit(this, wxID_ANY); + mpNoteMinEdit->SetValueName("Note Minimum"); + mpNoteMinEdit->SetMinAndMax(0, 127); + mpNoteMaxEdit = new JZIntegerEdit(this, wxID_ANY); + mpNoteMaxEdit->SetValueName("Note Maximum"); + mpNoteMaxEdit->SetMinAndMax(0, 127); + + mpPolyAftertouchCheckBox = new wxCheckBox(this, wxID_ANY, "Poly Aftertouch"); + mpPolyAftertouchMinEdit = new JZIntegerEdit(this, wxID_ANY); + mpPolyAftertouchMinEdit->SetValueName("Poly Aftertouch Minimum"); + mpPolyAftertouchMinEdit->SetMinAndMax(0, 127); + mpPolyAftertouchMaxEdit = new JZIntegerEdit(this, wxID_ANY); + mpPolyAftertouchMaxEdit->SetValueName("Poly Aftertouch Maximum"); + mpPolyAftertouchMaxEdit->SetMinAndMax(0, 127); + + mpControllerCheckBox = new wxCheckBox(this, wxID_ANY, "Controller"); + mpControllerMinEdit = new JZIntegerEdit(this, wxID_ANY); + mpControllerMinEdit->SetValueName("Controller Minimum"); + mpControllerMinEdit->SetMinAndMax(0, 127); + mpControllerMaxEdit = new JZIntegerEdit(this, wxID_ANY); + mpControllerMaxEdit->SetValueName("Controller Maximum"); + mpControllerMaxEdit->SetMinAndMax(0, 127); + + mpPatchCheckBox = new wxCheckBox(this, wxID_ANY, "Patch"); + mpPatchMinEdit = new JZIntegerEdit(this, wxID_ANY); + mpPatchMinEdit->SetValueName("Patch Minimum"); + mpPatchMinEdit->SetMinAndMax(0, 127); + mpPatchMaxEdit = new JZIntegerEdit(this, wxID_ANY); + mpPatchMaxEdit->SetValueName("Patch Maximum"); + mpPatchMaxEdit->SetMinAndMax(0, 127); + + mpPitchCheckBox = new wxCheckBox(this, wxID_ANY, "Pitch"); + mpPitchMinEdit = new JZIntegerEdit(this, wxID_ANY); + mpPitchMinEdit->SetValueName("Pitch Minimum"); + mpPitchMinEdit->SetMinAndMax(-8192, 8192); + mpPitchMaxEdit = new JZIntegerEdit(this, wxID_ANY); + mpPitchMaxEdit->SetValueName("Pitch Maximum"); + mpPitchMaxEdit->SetMinAndMax(-8192, 8192); + + mpMeterCheckBox = new wxCheckBox(this, wxID_ANY, "Meter"); + + mpChannelAftertouchCheckBox = + new wxCheckBox(this, wxID_ANY, "Channel Aftertouch"); + + mpSysExCheckBox = new wxCheckBox(this, wxID_ANY, "SysEx"); + + mpOtherBox = new wxCheckBox(this, wxID_ANY, "Other"); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + wxFlexGridSizer* pFlexGridSizer; + + pFlexGridSizer = new wxFlexGridSizer(2, 4, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "From Time:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpFromTimeEdit, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "To Time:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpToTimeEdit, + 0, + wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "From Track:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpFromTrackEdit, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "To Track:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpToTrackEdit, + 0, + wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 10); + + pFlexGridSizer = new wxFlexGridSizer(5, 5, 4, 2); + + pFlexGridSizer->Add( + mpNoteCheckBox, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Min:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpNoteMinEdit, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Max:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpNoteMaxEdit, + 0, + wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + mpPolyAftertouchCheckBox, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Min:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpPolyAftertouchMinEdit, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Max:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpPolyAftertouchMaxEdit, + 0, + wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + mpControllerCheckBox, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Min:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpControllerMinEdit, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Max:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpControllerMaxEdit, + 0, + wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + mpPatchCheckBox, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Min:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpPatchMinEdit, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Max:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpPatchMaxEdit, + 0, + wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + mpPitchCheckBox, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Min:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpPitchMinEdit, + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Max:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpPitchMaxEdit, + 0, + wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 10); + + wxBoxSizer* pCheckBoxSizer = new wxBoxSizer(wxHORIZONTAL); + + pCheckBoxSizer->Add(mpMeterCheckBox, 0, wxALL, 5); + + pCheckBoxSizer->Add(mpChannelAftertouchCheckBox, 0, wxALL, 5); + + pCheckBoxSizer->Add(mpSysExCheckBox, 0, wxALL, 5); + + pCheckBoxSizer->Add(mpOtherBox, 0, wxALL, 5); + + pTopSizer->Add(pCheckBoxSizer, 0, wxCENTER | wxALL, 5); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZShiftDialog::TransferDataToWindow() +{ + string TimeString; + + mFilter.GenerateFromTimeString(TimeString); + mpFromTimeEdit->ChangeValue(TimeString); + + mFilter.GenerateToTimeString(TimeString); + mpToTimeEdit->ChangeValue(TimeString); + + mpFromTrackEdit->SetNumber(mFilter.GetFromTrack()); + mpToTrackEdit->SetNumber(mFilter.GetToTrack()); + + bool Selected; + int FromValue, ToValue; + + mFilter.GetFilterEvent(eFilterKeyOn, Selected, FromValue, ToValue); + mpNoteCheckBox->SetValue(Selected); + mpNoteMinEdit->SetNumber(FromValue); + mpNoteMaxEdit->SetNumber(ToValue); + + mFilter.GetFilterEvent(eFilterKeyPressure, Selected, FromValue, ToValue); + mpPolyAftertouchCheckBox->SetValue(Selected); + mpPolyAftertouchMinEdit->SetNumber(FromValue); + mpPolyAftertouchMaxEdit->SetNumber(ToValue); + + mFilter.GetFilterEvent(eFilterControl, Selected, FromValue, ToValue); + mpControllerCheckBox->SetValue(Selected); + mpControllerMinEdit->SetNumber(FromValue); + mpControllerMaxEdit->SetNumber(ToValue); + + mFilter.GetFilterEvent(eFilterProgram, Selected, FromValue, ToValue); + mpPatchCheckBox->SetValue(Selected); + mpPatchMinEdit->SetNumber(FromValue); + mpPatchMaxEdit->SetNumber(ToValue); + + mFilter.GetFilterEvent(eFilterPitch, Selected, FromValue, ToValue); + mpPitchCheckBox->SetValue(Selected); + mpPitchMinEdit->SetNumber(FromValue); + mpPitchMaxEdit->SetNumber(ToValue); + + mpMeterCheckBox->SetValue(mFilter.GetFilterMeter()); + + mpChannelAftertouchCheckBox->SetValue(mFilter.GetFilterChannelAftertouch()); + + mpSysExCheckBox->SetValue(mFilter.GetFilterSysEx()); + + mpOtherBox->SetValue(mFilter.GetFilterOther()); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZShiftDialog::TransferDataFromWindow() +{ + int FromTrack, ToTrack; + int NoteMin, NoteMax; + int PolyAftertouchMin, PolyAftertouchMax; + int ControllerMin, ControllerMax; + int PatchMin, PatchMax; + int PitchMin, PitchMax; + + if ( + mpFromTrackEdit->GetNumber(FromTrack) && + mpToTrackEdit->GetNumber(ToTrack) && + mpNoteMinEdit->GetNumber(NoteMin) && + mpNoteMaxEdit->GetNumber(NoteMax) && + mpPolyAftertouchMinEdit->GetNumber(PolyAftertouchMin) && + mpPolyAftertouchMaxEdit->GetNumber(PolyAftertouchMax) && + mpControllerMinEdit->GetNumber(ControllerMin) && + mpControllerMaxEdit->GetNumber(ControllerMax) && + mpPatchMinEdit->GetNumber(PatchMin) && + mpPatchMaxEdit->GetNumber(PatchMax) && + mpPitchMinEdit->GetNumber(PitchMin) && + mpPitchMaxEdit->GetNumber(PitchMax)) + { + if (FromTrack > ToTrack) + { + ::wxMessageBox( + "The From Track must be less than or equal to the To Track", + "Invalid Track Values", + wxOK | wxICON_EXCLAMATION, + this); + + mpFromTrackEdit->SetFocus(); + + return false; + } + + if (NoteMin > NoteMax) + { + ::wxMessageBox( + "The Minimum Note must be less than or equal to the Maximum Note", + "Invalid Note Values", + wxOK | wxICON_EXCLAMATION, + this); + + mpNoteMinEdit->SetFocus(); + + return false; + } + + if (PolyAftertouchMin > PolyAftertouchMax) + { + ::wxMessageBox( + "The Minimum Poly Aftertouch must be less than or equal to the Maximum" + " Poly Aftertouch", + "Invalid Poly Aftertouch Values", + wxOK | wxICON_EXCLAMATION, + this); + + mpPolyAftertouchMinEdit->SetFocus(); + + return false; + } + + if (ControllerMin > ControllerMax) + { + ::wxMessageBox( + "The Minimum Controller must be less than or equal to the Maximum" + " Controller", + "Invalid Controller Values", + wxOK | wxICON_EXCLAMATION, + this); + + mpControllerMinEdit->SetFocus(); + + return false; + } + + if (PatchMin > PatchMax) + { + ::wxMessageBox( + "The Minimum Patch must be less than or equal to the Maximum Patch", + "Invalid Patch Values", + wxOK | wxICON_EXCLAMATION, + this); + + mpPatchMinEdit->SetFocus(); + + return false; + } + + if (PitchMin > PitchMax) + { + ::wxMessageBox( + "The Minimum Pitch must be less than or equal to the Maximum Pitch", + "Invalid Pitch Values", + wxOK | wxICON_EXCLAMATION, + this); + + mpPitchMinEdit->SetFocus(); + + return false; + } + + string TimeString; + + TimeString = mpFromTimeEdit->GetValue(); + mFilter.SetFromTime(TimeString); + + TimeString = mpToTimeEdit->GetValue(); + mFilter.SetToTime(TimeString); + + mFilter.SetFromTrack(FromTrack); + mFilter.SetToTrack(ToTrack); + + mFilter.SetFilterEvent( + eFilterKeyOn, + mpNoteCheckBox->GetValue(), + NoteMin, + NoteMax); + + mFilter.SetFilterEvent( + eFilterKeyPressure, + mpPolyAftertouchCheckBox->GetValue(), + PolyAftertouchMin, + PolyAftertouchMax); + + mFilter.SetFilterEvent( + eFilterControl, + mpControllerCheckBox->GetValue(), + ControllerMin, + ControllerMax); + + mFilter.SetFilterEvent( + eFilterProgram, + mpPatchCheckBox->GetValue(), + PatchMin, + PatchMax); + + mFilter.SetFilterEvent( + eFilterPitch, + mpPitchCheckBox->GetValue(), + PitchMin, + PitchMax); + + mFilter.SetFilterMeter(mpMeterCheckBox->GetValue()); + + mFilter.SetFilterChannelAftertouch( + mpChannelAftertouchCheckBox->GetValue()); + + mFilter.SetFilterSysEx(mpSysExCheckBox->GetValue()); + + mFilter.SetFilterOther(mpOtherBox->GetValue()); + + return true; + } + + return false; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZShiftDialog::OnHelp(wxCommandEvent& Event) +{ +// gpHelpInstance->ShowTopic("Filter Dialog"); +} Property changes on: trunk/jazz/src/Dialogs/ShiftDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/ShiftDialog.h =================================================================== --- trunk/jazz/src/Dialogs/ShiftDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/ShiftDialog.h 2009-01-02 18:37:48 UTC (rev 680) @@ -0,0 +1,93 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2008 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_SHIFTDIALOG_H +#define JZ_SHIFTDIALOG_H + +#include <wx/dialog.h> + +class JZEventFrame; +class JZFilter; +class JZIntegerEdit; +class wxCheckBox; +class wxTextCtrl; + +//***************************************************************************** +//***************************************************************************** +class JZShiftDialog : public wxDialog +{ + public: + + JZShiftDialog( + JZEventFrame& EventWindow, + JZFilter& Filter, + wxWindow* pParent); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnHelp(wxCommandEvent& Event); + + private: + + JZFilter& mFilter; + + wxTextCtrl* mpFromTimeEdit; + wxTextCtrl* mpToTimeEdit; + + JZIntegerEdit* mpFromTrackEdit; + JZIntegerEdit* mpToTrackEdit; + + wxCheckBox* mpNoteCheckBox; + JZIntegerEdit* mpNoteMinEdit; + JZIntegerEdit* mpNoteMaxEdit; + + wxCheckBox* mpPolyAftertouchCheckBox; + JZIntegerEdit* mpPolyAftertouchMinEdit; + JZIntegerEdit* mpPolyAftertouchMaxEdit; + + wxCheckBox* mpControllerCheckBox; + JZIntegerEdit* mpControllerMinEdit; + JZIntegerEdit* mpControllerMaxEdit; + + wxCheckBox* mpPatchCheckBox; + JZIntegerEdit* mpPatchMinEdit; + JZIntegerEdit* mpPatchMaxEdit; + + wxCheckBox* mpPitchCheckBox; + JZIntegerEdit* mpPitchMinEdit; + JZIntegerEdit* mpPitchMaxEdit; + + wxCheckBox* mpMeterCheckBox; + + wxCheckBox* mpChannelAftertouchCheckBox; + + wxCheckBox* mpSysExCheckBox; + + wxCheckBox* mpOtherBox; + + DECLARE_EVENT_TABLE(); +}; + + +#endif // !defined(JZ_SHIFTDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/ShiftDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-01-01 08:46:37 UTC (rev 679) +++ trunk/jazz/src/Dialogs.cpp 2009-01-02 18:37:48 UTC (rev 680) @@ -28,6 +28,7 @@ #include "Dialogs/KeyOnDialog.h" #include "Events.h" #include "EventWindow.h" +#include "Filter.h" #include "Globals.h" #include "Help.h" #include "NamedChoice.h" @@ -982,7 +983,7 @@ { Event = e; text=new char[2048]; - strcpy(text,(const char*)(e->GetText())); + strcpy(text, (const char*)(e->GetText())); } Added: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp (rev 0) +++ trunk/jazz/src/EventFrame.cpp 2009-01-02 18:37:48 UTC (rev 680) @@ -0,0 +1,512 @@ +#include "EventFrame.h" + +#include "Command.h" +#include "Dialogs/ShiftDialog.h" +#include "Dialogs.h" +#include "Filter.h" +#include "MouseAction.h" +#include "ToolBar.h" + +#include <wx/dc.h> +#include <wx/msgdlg.h> + +#include <iostream> + +using namespace std; + +//***************************************************************************** +// Description: +// This is the event frame class definition. +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZEventFrame, wxFrame) + EVT_SIZE(JZEventFrame::OnSize) +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZEventFrame::JZEventFrame( + wxWindow* pParent, + const wxString& Title, + JZSong* pSong, + const wxPoint& Position, + const wxSize& Size) + : wxFrame(pParent, wxID_ANY, Title, Position, Size), + Song(pSong), + mpFilter(0), + mpFixedFont(0), + hFixedFont(0), + mTrackHeight(0), + mTopInfoHeight(40), + FontSize(12), + ClocksPerPixel(36), + mEventsX(), + mEventsY(mTopInfoHeight), + mEventsWidth(0), + mEventsHeight(0), + CanvasX(0), + CanvasY(0), + CanvasW(0), + CanvasH(0), + FromClock(0), + ToClock(0), + FromLine(0), + ToLine(0), + SnapSel(0), + MouseAction(0), + PlayClock(-1), + mpSettingsDialog(0), + MixerForm(0), + mpToolBar(0), + mpGreyColor(0), + mpGreyBrush(0) +{ +#ifdef __WXMSW__ + mpGreyColor = new wxColor(192, 192, 192); +#else + mpGreyColor = new wxColor(220, 220, 220); +#endif + mpGreyBrush = new wxBrush(*mpGreyColor, wxSOLID); + + mpFilter = new JZFilter(Song); +} + +JZEventFrame::~JZEventFrame() +{ + delete SnapSel; + + delete mpGreyColor; + delete mpGreyBrush; + + delete mpFilter; + + delete mpFixedFont; + + delete mpToolBar; + + if (MixerForm) + { + delete MixerForm; + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::CreateMenu() +{ +} + + +//----------------------------------------------------------------------------- +// create the canvas component(used for differently dependingon the subclass) +// size it to the client area of the frame(frame size minus toolbar and menus ) +//----------------------------------------------------------------------------- +//void JZEventFrame::CreateCanvas() +//{ +// cout << "CreateCanvas" << endl; +// int Width, Height; +// GetClientSize(&Width, &Height); +// mpEventWindow = new JZEventWindow(this, 0, 0, Width, Height); +//} + +/** +second phase of creation. make menus, the canvas, and so on +*/ +void JZEventFrame::Create() +{ + CreateMenu(); + + Setup(); +} + +//----------------------------------------------------------------------------- +// Initialize the constants used in drawing. +//----------------------------------------------------------------------------- +void JZEventFrame::Setup() +{ +/* + int x, y; + + wxClientDC Dc(mpEventWindow); + Dc.SetFont(wxNullFont); + delete mpFixedFont; + mpFixedFont = new wxFont(12, wxSWISS, wxNORMAL, wxNORMAL); + Dc.SetFont(*mpFixedFont); + Dc.GetTextExtent("M", &x, &y); + hFixedFont = (int)y; + + delete mpFont; + mpFont = new wxFont(FontSize, wxSWISS, wxNORMAL, wxNORMAL); + Dc.SetFont(*mpFont); + + Dc.GetTextExtent("M", &x, &y); + mLittleBit = (int)(x/2); + + Dc.GetTextExtent("HXWjgi", &x, &y); + mTrackHeight = (int)y + mLittleBit; +*/ +} + +//----------------------------------------------------------------------------- +// this onsize handler is supposed to take care of handling of the resizing +// the two subwindows sizes to they dont overlap +//----------------------------------------------------------------------------- +void JZEventFrame::OnSize(wxSizeEvent& Event) +{ +// wxFrame::OnSize(Event); + + // The code below is from the toolbar sample, the layoutchidlren function + wxSize size = GetClientSize(); + + int offset; +// if (mpToolBar) +// { +// mpToolBar->SetSize(-1, size.y); +// mpToolBar->Move(0, 0); +// +// offset = mpToolBar->GetSize().x; +// } +// else +// { +// offset = 0; +// } + + // The step below should set the offset of the mpEventWindow + // m_textWindow->SetSize(offset, 0, size.x - offset, size.y); + +// float maxToolBarWidth = 0.0; +// float maxToolBarHeight = 0.0; +// if (mpToolBar) +// { +// mpToolBar->GetMaxSize(&maxToolBarWidth, &maxToolBarHeight); +// } + + offset = mpToolBar->GetSize().y; //get the height of the toolbar + + int frameWidth, frameHeight; + GetClientSize(&frameWidth, &frameHeight); + +// if (mpEventWindow) +// // mpEventWindow->SetSize(0, (int)offset, (int)frameWidth, (int)(frameHeight - offset)); +// mpEventWindow->SetSize(0, (int)0, (int)frameWidth, (int)(frameHeight)); +// // if (mpToolBar) +// // mpToolBar->SetSize(0, 0, (int)frameWidth, (int)maxToolBarHeight); + + cout + << "JZEventFrame::OnSize " << frameWidth<< 'x' << frameHeight << endl; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZEventFrame::OnCharHook(wxKeyEvent& e) +{ + return OnKeyEvent(e); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZEventFrame::y2yLine(int y, int up) +{ + if (up) + { + y += mTrackHeight; + } + y -= mTopInfoHeight; + y -= y % mTrackHeight; + y += mTopInfoHeight; + return y; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZEventFrame::y2Line(int y, int up) +{ + if (up) + { + y += mTrackHeight; + } + y -= mTopInfoHeight; + return y / mTrackHeight; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZEventFrame::Line2y(int Line) +{ + return Line * mTrackHeight + mTopInfoHeight; +} + +/* +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::LineText(wxDC *dc, int x, int y, int w, const char *str, int h, bool down) +{ + if (h <= 0) + { + h = mTrackHeight; + y = y2yLine(y); + } + if (w && h) + { + //dc->SetBrush(wxGREY_BRUSH); + dc->SetBrush(*mpGreyBrush); + dc->SetPen(*wxGREY_PEN); + #ifdef __WXMSW__ + dc->DrawRectangle(x, y, w+1, h+1); + #else + dc->DrawRectangle(x, y, w, h); + #endif + x += 1; + y += 1; + w -= 2; + h -= 2; + if (down) + { + dc->SetPen(*wxBLACK_PEN); + dc->DrawLine(x, y, x+w, y); + dc->DrawLine(x, y, x, y+h); + dc->SetPen(*wxWHITE_PEN); + dc->DrawLine(x+w, y, x+w, y+h); + dc->DrawLine(x, y+h, x+w, y+h); + } + else + { + dc->SetPen(*wxWHITE_PEN); + dc->DrawLine(x, y, x+w, y); + dc->DrawLine(x, y, x, y+h); + dc->SetPen(*wxBLACK_PEN); + dc->DrawLine(x+w, y, x+w, y+h); + dc->DrawLine(x, y+h, x+w, y+h); + } + dc->SetPen(*wxBLACK_PEN); + x -= 2; + y -= 2; + } + dc->SetTextBackground(*mpGreyColor); + dc->DrawText((char *)str, x + mLittleBit, y + mLittleBit); + dc->SetTextBackground(*wxWHITE); +} +*/ + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::Redraw() +{ +// wxDC* dc=new wxClientDC(this); +// wxPaintEvent e; +// cout<<"FIXME JZEventFrame::Redraw"<<endl; +// mpEventWindow->OnDraw(*dc); //this will in turn call the eventwin onpaintsub +// //the problem is that onpaint no longer tkes no argument, and is supposed to be called from the framework only, so it should be split +// delete dc; + +// mpEventWindow->Refresh(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZEventFrame::OnKeyEvent(wxKeyEvent &e) +{ + return false; +} + +//----------------------------------------------------------------------------- +// seems to handle the "selection" rectangle. normally called from the base +// class onmouseevent handler +//----------------------------------------------------------------------------- +int JZEventFrame::OnMouseEvent(wxMouseEvent &e) +{ + // cout <<"JZEventFrame::OnMouseEvent"<<endl; + if (!MouseAction) + { + // create SnapSel? + int x; + int y; + e.GetPosition(&x, &y); + if (mEventsX < x && x < mEventsX + mEventsWidth && mEventsY < y && y < mEventsY + mEventsHeight) + { + if (e.LeftDown()) + { + { + SnapSelStart(e); + + if (SnapSel->IsSelected()) + { + Refresh(); //redraw the whole window instead(inefficient, we should rather invalidate a rect) + } + SnapSel->Event(e); + MouseAction = SnapSel; + } + } + } + } + else + { + // MouseAction active + + if (MouseAction->Event(e)) + { + // MouseAction finished + + if (MouseAction == SnapSel) + { + SnapSelStop(e); + Redraw(); //ineficcient, invalidate rect first instead + MouseAction = 0; + return 1; + } + + MouseAction = 0; + } + } + return 0; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZEventFrame::OnClose() +{ + return FALSE; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::OnMenuCommand(int) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::SnapSelStart(wxMouseEvent& MouseEvent) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::SnapSelStop(wxMouseEvent& MouseEvent) +{ +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +int JZEventFrame::EventsSelected(const char* msg) +{ + if (!SnapSel->IsSelected()) + { + if (msg == 0) + { + msg = "please select some events first"; + } + wxMessageBox((char *)msg, "Error", wxOK); + return 0; + } + return 1; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::MenQuantize() +{ + if (!EventsSelected()) + return; + // wxDialogBox *panel = new wxDialogBox(this, "Quantize", FALSE ); + tQuantizeDlg * dlg = new tQuantizeDlg(this, mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::MenCleanup() +{ + if (!EventsSelected()) + return; + tCleanupDlg * dlg = new tCleanupDlg(this, mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::MenSearchReplace() +{ + if (!EventsSelected()) + return; + tSearchReplaceDlg * dlg = new tSearchReplaceDlg(this, mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::MenSetChannel() +{ + if (!EventsSelected()) + return; + tSetChannelDlg * dlg = new tSetChannelDlg(mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::MenTranspose() +{ + if (!EventsSelected()) + return; + tTransposeDlg * dlg = new tTransposeDlg(this, mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +// show the "shift events" dialog +//----------------------------------------------------------------------------- +void JZEventFrame::MenShift(int Unit) +{ + if (EventsSelected()) + { + JZShiftDialog ShiftDialog(*this, *mpFilter, this); + + if (ShiftDialog.ShowModal() == wxID_OK) + { + } + } +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::MenDelete() +{ + if (!EventsSelected()) + return; + tDeleteDlg * dlg = new tDeleteDlg(this, mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::MenVelocity() +{ + if (!EventsSelected()) + return; + tVelocityDlg * dlg = new tVelocityDlg(mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::MenLength() +{ + if (!EventsSelected()) + return; + tLengthDlg * dlg = new tLengthDlg(this, mpFilter); + dlg->Create(); +} + +//----------------------------------------------------------------------------- +// convert to modulation +//----------------------------------------------------------------------------- +void JZEventFrame::MenConvertToModulation() +{ + if (!EventsSelected()) + return; + tCmdConvertToModulation cmd(mpFilter); + cmd.Execute(); + Redraw(); +} Property changes on: trunk/jazz/src/EventFrame.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h (rev 0) +++ trunk/jazz/src/EventFrame.h 2009-01-02 18:37:48 UTC (rev 680) @@ -0,0 +1,149 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. +// Modifications Copyright (C) 2004 Patrick Earl +// Modifications Copyright (C) 2008 Peter J. Stieber +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_EVENTFRAME_H +#define JZ_EVENTFRAME_H + +#include <wx/frame.h> + +class JZFilter; +class JZSnapSelection; +class JZSong; +class JZToolBar; +class tMouseAction; +class wxDialog; + +//***************************************************************************** +// Description: +// A frame window that containes a scrolled event window. Acts as the +// common base class for JZTrackFrame and JSPianoFrame. +// +// The panel and menu are administered by derived classes. +// Functionality: +// - Settings dialog +// - Selection via Snapsel +//***************************************************************************** +class JZEventFrame : public wxFrame +{ + public: + + bool OnCharHook(wxKeyEvent& event); + void OnChar(wxKeyEvent& event); + + // 2-step initialization: 1) constructor + JZEventFrame( + wxWindow* pParent, + const wxString& Title, + JZSong* pSong, + const wxPoint& Position = wxDefaultPosition, + const wxSize& Size = wxDefaultSize); + + virtual ~JZEventFrame(); + + JZSong* Song; + + JZFilter* mpFilter; + + // 2) Create(): + virtual void Create(); + virtual void CreateMenu(); + void CreateCanvas(); +// JZEventWindow* mpEventWindow; + + // Setup() + wxFont* mpFixedFont; // remains with 12pt + int hFixedFont; // Height of letters + + int mTrackHeight; + + int mTopInfoHeight; + int FontSize; + int ClocksPerPixel; + + // Parameters changed, e.g. Song loaded + virtual void Setup(); + + int mEventsX, mEventsY, mEventsWidth, mEventsHeight; + int CanvasX, CanvasY, CanvasW, CanvasH; // canvas coords + int FromClock, ToClock; + int FromLine, ToLine; + + // Mousehandling + JZSnapSelection* SnapSel; + tMouseAction* MouseAction; + virtual void SnapSelStart(wxMouseEvent &e); + virtual void SnapSelStop(wxMouseEvent &e); + + // methods + int y2Line(int y, int up = 0); + int y2yLine(int y, int up = 0); + int Line2y(int line); +// void LineText(wxDC *dc, int x, int y, int w, const char *str, int h = -1, bool down = false); + + int PlayClock; + + // Events + virtual int OnMouseEvent(wxMouseEvent& Event); + virtual bool OnKeyEvent(wxKeyEvent& Event); // true = processed by eventwin + virtual void OnSize(wxSizeEvent& Event); + virtual void OnMenuCommand(int id); + virtual bool OnClose(); + + // Redraw - nach Aenderungen von Parametern, kein GUI-Event + virtual void Redraw(); + + // Settings-Dialog + wxDialog* mpSettingsDialog; + void SettingsDialog(int piano); + + // Mixer-Dialog + wxDialog* MixerForm; + + // Edit-Menu + + // if selection active: TRUE, else: Errormessage + FALSE + int EventsSelected(const char* msg = 0); + + void MenQuantize(); + void MenSetChannel(); + void MenTranspose(); + void MenShift(int Unit); + void MenDelete(); + void MenVelocity(); + void MenLength(); + void MenSeqLength(); + void MenMidiDelay(); + void MenConvertToModulation(); + void MenCleanup(); + void MenSearchReplace(); + void MenMeterChange(); + + protected: + + JZToolBar* mpToolBar; + wxColor* mpGreyColor; + wxBrush* mpGreyBrush; + + DECLARE_EVENT_TABLE() +}; + +#endif // !defined(JZ_EVENTFRAME_H) Property changes on: trunk/jazz/src/EventFrame.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-01-01 08:46:37 UTC (rev 679) +++ trunk/jazz/src/EventWindow.cpp 2009-01-02 18:37:48 UTC (rev 680) @@ -22,15 +22,13 @@ #include "EventWindow.h" -#include "PianoFrame.h" +#include "EventFrame.h" +#include "Filter.h" +#include "MouseAction.h" #include "Song.h" -#include "Command.h" -#include "Dialogs.h" #include "Help.h" -#include "ToolBar.h" #include "PropertyListDialog.h" -#include <wx/brush.h> #include <wx/dc.h> #include <wx/msgdlg.h> @@ -346,500 +344,6 @@ //} //***************************************************************************** -// Description: -// This is the event frame class definition. -//***************************************************************************** -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -BEGIN_EVENT_TABLE(JZEventFrame, wxFrame) - EVT_SIZE(JZEventFrame::OnSize) -END_EVENT_TABLE() - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -JZEventFrame::JZEventFrame( - wxWindow* pParent, - const wxString& Title, - JZSong* pSong, - const wxPoint& Position, - const wxSize& Size) - : wxFrame(pParent, wxID_ANY, Title, Position, Size), - Song(pSong), - mpFilter(0), - mpFixedFont(0), - hFixedFont(0), - mTrackHeight(0), - mTopInfoHeight(40), - FontSize(12), - ClocksPerPixel(36), - mEventsX(), - mEventsY(mTopInfoHeight), - mEventsWidth(0), - mEventsHeight(0), - CanvasX(0), - CanvasY(0), - CanvasW(0), - CanvasH(0), - FromClock(0), - ToClock(0), - FromLine(0), - ToLine(0), - SnapSel(0), - MouseAction(0), - PlayClock(-1), - mpSettingsDialog(0), - MixerForm(0), - mpToolBar(0), - mpGreyColor(0), - mpGreyBrush(0) -{ -#ifdef __WXMSW__ - mpGreyColor = new wxColor(192, 192, 192); -#else - mpGreyColor = new wxColor(220, 220, 220); -#endif - mpGreyBrush = new wxBrush(*mpGreyColor, wxSOLID); - - mpFilter = new JZFilter(Song); -} - -JZEventFrame::~JZEventFrame() -{ - delete SnapSel; - - delete mpGreyColor; - delete mpGreyBrush; - - delete mpFilter; - - delete mpFixedFont; - - delete mpToolBar; - - if (MixerForm) - { - delete MixerForm; - } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::CreateMenu() -{ -} - - -//----------------------------------------------------------------------------- -// create the canvas component(used for differently dependingon the subclass) -// size it to the client area of the frame(frame size minus toolbar and menus ) -//----------------------------------------------------------------------------- -//void JZEventFrame::CreateCanvas() -//{ -// cout << "CreateCanvas" << endl; -// int Width, Height; -// GetClientSize(&Width, &Height); -// mpEventWindow = new JZEventWindow(this, 0, 0, Width, Height); -//} - -/** -second phase of creation. make menus, the canvas, and so on -*/ -void JZEventFrame::Create() -{ - CreateMenu(); - - Setup(); -} - -//----------------------------------------------------------------------------- -// Initialize the constants used in drawing. -//----------------------------------------------------------------------------- -void JZEventFrame::Setup() -{ -/* - int x, y; - - wxClientDC Dc(mpEventWindow); - Dc.SetFont(wxNullFont); - delete mpFixedFont; - mpFixedFont = new wxFont(12, wxSWISS, wxNORMAL, wxNORMAL); - Dc.SetFont(*mpFixedFont); - Dc.GetTextExtent("M", &x, &y); - hFixedFont = (int)y; - - delete mpFont; - mpFont = new wxFont(FontSize, wxSWISS, wxNORMAL, wxNORMAL); - Dc.SetFont(*mpFont); - - Dc.GetTextExtent("M", &x, &y); - mLittleBit = (int)(x/2); - - Dc.GetTextExtent("HXWjgi", &x, &y); - mTrackHeight = (int)y + mLittleBit; -*/ -} - -//----------------------------------------------------------------------------- -// this onsize handler is supposed to take care of handling of the resizing -// the two subwindows sizes to they dont overlap -//----------------------------------------------------------------------------- -void JZEventFrame::OnSize(wxSizeEvent& Event) -{ -// wxFrame::OnSize(Event); - - // The code below is from the toolbar sample, the layoutchidlren function - wxSize size = GetClientSize(); - - int offset; -// if (mpToolBar) -// { -// mpToolBar->SetSize(-1, size.y); -// mpToolBar->Move(0, 0); -// -// offset = mpToolBar->GetSize().x; -// } -// else -// { -// offset = 0; -// } - - // The step below should set the offset of the mpEventWindow - // m_textWindow->SetSize(offset, 0, size.x - offset, size.y); - -// float maxToolBarWidth = 0.0; -// float maxToolBarHeight = 0.0; -// if (mpToolBar) -// { -// mpToolBar->GetMaxSize(&maxToolBarWidth, &maxToolBarHeight); -// } - - offset = mpToolBar->GetSize().y; //get the height of the toolbar - - int frameWidth, frameHeight; - GetClientSize(&frameWidth, &frameHeight); - -// if (mpEventWindow) -// // mpEventWindow->SetSize(0, (int)offset, (int)frameWidth, (int)(frameHeight - offset)); -// mpEventWindow->SetSize(0, (int)0, (int)frameWidth, (int)(frameHeight)); -// // if (mpToolBar) -// // mpToolBar->SetSize(0, 0, (int)frameWidth, (int)maxToolBarHeight); - - cout - << "JZEventFrame::OnSize " << frameWidth<< 'x' << frameHeight << endl; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZEventFrame::OnCharHook(wxKeyEvent& e) -{ - return OnKeyEvent(e); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int JZEventFrame::y2yLine(int y, int up) -{ - if (up) - { - y += mTrackHeight; - } - y -= mTopInfoHeight; - y -= y % mTrackHeight; - y += mTopInfoHeight; - return y; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int JZEventFrame::y2Line(int y, int up) -{ - if (up) - { - y += mTrackHeight; - } - y -= mTopInfoHeight; - return y / mTrackHeight; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int JZEventFrame::Line2y(int Line) -{ - return Line * mTrackHeight + mTopInfoHeight; -} - -/* -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::LineText(wxDC *dc, int x, int y, int w, const char *str, int h, bool down) -{ - if (h <= 0) - { - h = mTrackHeight; - y = y2yLine(y); - } - if (w && h) - { - //dc->SetBrush(wxGREY_BRUSH); - dc->SetBrush(*mpGreyBrush); - dc->SetPen(*wxGREY_PEN); - #ifdef __WXMSW__ - dc->DrawRectangle(x, y, w+1, h+1); - #else - dc->DrawRectangle(x, y, w, h); - #endif - x += 1; - y += 1; - w -= 2; - h -= 2; - if (down) - { - dc->SetPen(*wxBLACK_PEN); - dc->DrawLine(x, y, x+w, y); - dc->DrawLine(x, y, x, y+h); - dc->SetPen(*wxWHITE_PEN); - dc->DrawLine(x+w, y, x+w, y+h); - dc->DrawLine(x, y+h, x+w, y+h); - } - else - { - dc->SetPen(*wxWHITE_PEN); - dc->DrawLine(x, y, x+w, y); - dc->DrawLine(x, y, x, y+h); - dc->SetPen(*wxBLACK_PEN); - dc->DrawLine(x+w, y, x+w, y+h); - dc->DrawLine(x, y+h, x+w, y+h); - } - dc->SetPen(*wxBLACK_PEN); - x -= 2; - y -= 2; - } - dc->SetTextBackground(*mpGreyColor); - dc->DrawText((char *)str, x + mLittleBit, y + mLittleBit); - dc->SetTextBackground(*wxWHITE); -} -*/ - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::Redraw() -{ -// wxDC* dc=new wxClientDC(this); -// wxPaintEvent e; -// cout<<"FIXME JZEventFrame::Redraw"<<endl; -// mpEventWindow->OnDraw(*dc); //this will in turn call the eventwin onpaintsub -// //the problem is that onpaint no longer tkes no argument, and is supposed to be called from the framework only, so it should be split -// delete dc; - -// mpEventWindow->Refresh(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZEventFrame::OnKeyEvent(wxKeyEvent &e) -{ - return false; -} - -//----------------------------------------------------------------------------- -// seems to handle the "selection" rectangle. normally called from the base -// class onmouseevent handler -//----------------------------------------------------------------------------- -int JZEventFrame::OnMouseEvent(wxMouseEvent &e) -{ - // cout <<"JZEventFrame::OnMouseEvent"<<endl; - if (!MouseAction) - { - // create SnapSel? - int x; - int y; - e.GetPosition(&x, &y); - if (mEventsX < x && x < mEventsX + mEventsWidth && mEventsY < y && y < mEventsY + mEventsHeight) - { - if (e.LeftDown()) - { - { - SnapSelStart(e); - - if (SnapSel->IsSelected()) - { - Refresh(); //redraw the whole window instead(inefficient, we should rather invalidate a rect) - } - SnapSel->Event(e); - MouseAction = SnapSel; - } - } - } - } - else - { - // MouseAction active - - if (MouseAction->Event(e)) - { - // MouseAction finished - - if (MouseAction == SnapSel) - { - SnapSelStop(e); - Redraw(); //ineficcient, invalidate rect first instead - MouseAction = 0; - return 1; - } - - MouseAction = 0; - } - } - return 0; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZEventFrame::OnClose() -{ - return FALSE; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::OnMenuCommand(int) -{ -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::SnapSelStart(wxMouseEvent& MouseEvent) -{ -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::SnapSelStop(wxMouseEvent& MouseEvent) -{ -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int JZEventFrame::EventsSelected(const char* msg) -{ - if (!SnapSel->IsSelected()) - { - if (msg == 0) - { - msg = "please select some events first"; - } - wxMessageBox((char *)msg, "Error", wxOK); - return 0; - } - return 1; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::MenQuantize() -{ - if (!EventsSelected()) - return; - // wxDialogBox *panel = new wxDialogBox(this, "Quantize", FALSE ); - tQuantizeDlg * dlg = new tQuantizeDlg(this, mpFilter); - dlg->Create(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::MenCleanup() -{ - if (!EventsSelected()) - return; - tCleanupDlg * dlg = new tCleanupDlg(this, mpFilter); - dlg->Create(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::MenSearchReplace() -{ - if (!EventsSelected()) - return; - tSearchReplaceDlg * dlg = new tSearchReplaceDlg(this, mpFilter); - dlg->Create(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::MenSetChannel() -{ - if (!EventsSelected()) - return; - tSetChannelDlg * dlg = new tSetChannelDlg(mpFilter); - dlg->Create(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::MenTranspose() -{ - if (!EventsSelected()) - return; - tTransposeDlg * dlg = new tTransposeDlg(this, mpFilter); - dlg->Create(); -} - -//----------------------------------------------------------------------------- -// show the "shift events" dialog -//----------------------------------------------------------------------------- -void JZEventFrame::MenShift(int Unit) -{ - if (EventsSelected()) - { - tShiftDlg * dlg = new tShiftDlg(this, mpFilter, Unit); - dlg->Create(); - } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::MenDelete() -{ - if (!EventsSelected()) - return; - tDeleteDlg * dlg = new tDeleteDlg(this, mpFilter); - dlg->Create(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::MenVelocity() -{ - if (!EventsSelected()) - return; - tVelocityDlg * dlg = new tVelocityDlg(mpFilter); - dlg->Create(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventFrame::MenLength() -{ - if (!EventsSelected()) - return; - tLengthDlg * dlg = new tLengthDlg(this, mpFilter); - dlg->Create(); -} - -//----------------------------------------------------------------------------- -// convert to modulation -//----------------------------------------------------------------------------- -void JZEventFrame::MenConvertToModulation() -{ - if (!EventsSelected()) - return; - tCmdConvertToModulation cmd(mpFilter); - cmd.Execute(); - Redraw(); -} - -//***************************************************************************** // MeterChange Dialog //***************************************************************************** class tMeterChangeDlg : public tPropertyListDlg Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2009-01-01 08:46:37 UTC (rev 679) +++ trunk/jazz/src/EventWindow.h 2009-01-02 18:37:48 UTC (rev 680) @@ -20,18 +20,14 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //***************************************************************************** -#ifndef JZ_EVENTFRAME_H -#define JZ_EVENTFRAME_H +#ifndef JZ_EVENTWINDOW_H +#define JZ_EVENTWINDOW_H -#include "Filter.h" -#include "MouseAction.h" +#include <wx/window.h> -#include <wx/frame.h> - -class JZEventFrame; +class JZFilter; +class JZSnapSelection; class JZSong; -class JZToolBar; -class JZPianoFrame; //***************************************************************************** // Description: @@ -132,118 +128,4 @@ return mpSong; } -//***************************************************************************** -// Description: -// A frame window that containes a scrolled event window. Acts as the -// common base class for JZTrackFrame and JSPianoFrame. -// -// The panel and menu are administered by derived classes. -// Functionality: -// - Settings dialog -// - Selection via Snapsel -//***************************************************************************** -class JZEventFrame : public wxFrame -{ - public: - - bool OnCharHook(wxKeyEvent& event); - void OnChar(wxKeyEvent& event); - - // 2-step initialization: 1) constructor - JZEventFrame( - wxWindow* pParent, - const wxString& Title, - JZSong* pSong, - const wxPoint& Position = wxDefaultPosition, - const wxSize& Size = wxDefaultSize); - - virtual ~JZEventFrame(); - - JZSong* Song; - - JZFilter* mpFilter; - - // 2) Create(): - virtual void Create(); - virtual void CreateMenu(); - void CreateCanvas(); -// JZEventWindow* mpEventWindow; - - // Setup() - wxFont* mpFixedFont; // remains with 12pt - int hFixedFont; // Height of letters - - int mTrackHeight; - - int mTopInfoHeight; - int FontSize; - int ClocksPerPixel; - - // Parameters changed, e.g. Song loaded - virtual void Setup(); - - int mEventsX, mEventsY, mEventsWidth, mEventsHeight; - int CanvasX, CanvasY, CanvasW, CanvasH; // canvas coords - int FromClock, ToClock; - int FromLine, ToLine; - - // Mousehandling - JZSnapSelection *SnapSel; - tMouseAction *MouseAction; - virtual void SnapSelStart(wxMouseEvent &e); - virtual void SnapSelStop(wxMouseEvent &e); - - // methods - int y2Line(int y, int up = 0); - int y2yLine(int y, int up = 0); - int Line2y(int line); -// void LineText(wxDC *dc, int x, int y, int w, const char *str, int h = -1, bool down = false); - - int PlayClock; - - // Events - virtual int OnMouseEvent(wxMouseEvent& Event); - virtual bool OnKeyEvent(wxKeyEvent& Event); // true = processed by eventwin - virtual void OnSize(wxSizeEvent& Event); - virtual void OnMenuCommand(int id); - virtual bool OnClose(); - - // Redraw - nach Aenderungen von Parametern, kein GUI-Event - virtual void Redraw(); - - // Settings-Dialog - wxDialog* mpSettingsDialog; - void SettingsDialog(int piano); - - // Mixer-Dialog - wxDialog* MixerForm; - - // Edit-Menu - - // if selection active: TRUE, else: Errormessage + FALSE - int EventsSelected(const char* msg = 0); - - void MenQuantize(); - void MenSetChannel(); - void MenTranspose(); - void MenShift(int Unit); - void MenDelete(); - void MenVelocity(); - void MenLength(); - void MenSeqLength(); - void MenMidiDelay(); - void MenConvertToModulation(); - void MenCleanup(); - void MenSearchReplace(); - void MenMeterChange(); - - protected: - - JZToolBar* mpToolBar; - wxColor* mpGreyColor; - wxBrush* mpGreyBrush; - - DECLARE_EVENT_TABLE() -}; - -#endif // !defined(JZ_EVENTFRAME_H) +#endif // !defined(JZ_EVENTWINDOW_H) Modified: trunk/jazz/src/HarmonyBrowserAnalyzer.cpp =================================================================== --- trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2009-01-01 08:46:37 UTC (rev 679) +++ trunk/jazz/src/HarmonyBrowserAnalyzer.cpp 2009-01-02 18:37:48 UTC (rev 680) @@ -22,8 +22,9 @@ #include "HarmonyBrowserAnalyzer.h" +#include "Command.h" #include "EventWindow.h" -#include "Command.h" +#include "Filter.h" #include "Harm... [truncated message content] |
From: <pst...@us...> - 2009-02-16 05:04:04
|
Revision: 698 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=698&view=rev Author: pstieber Date: 2009-02-16 05:03:58 +0000 (Mon, 16 Feb 2009) Log Message: ----------- 1. Added a placeholder for a new velocity dialog. 2. Updated some meter change resource ID. 3. Updated the names of some wxWidgets event handlers. 4. Moved the meter change dialog from the event window source files to the dialog source files. 5. Made cosmetic changes. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventFrame.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/Makefile.am trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/Resources.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/VelocityDialog.cpp trunk/jazz/src/Dialogs/VelocityDialog.h Added: trunk/jazz/src/Dialogs/VelocityDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/VelocityDialog.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -0,0 +1,5 @@ +#include "VelocityDialog.h" + +JZVelocityDialog::JZVelocityDialog() +{ +} Property changes on: trunk/jazz/src/Dialogs/VelocityDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/VelocityDialog.h =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/VelocityDialog.h 2009-02-16 05:03:58 UTC (rev 698) @@ -0,0 +1,14 @@ +#ifndef JZ_VELOCITYDIALOG_H +#define JZ_VELOCITYDIALOG_H + +#include <wx/dialog.h> + +class JZVelocityDialog : public wxDialog +{ + public: + + JZVelocityDialog(); + +}; + +#endif // !defined(JZ_VELOCITYDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/VelocityDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/Dialogs.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -26,6 +26,7 @@ #include "Command.h" #include "DeprecatedWx/proplist.h" #include "Dialogs/KeyOnDialog.h" +//#include "EventFrame.h" #include "Events.h" #include "EventWindow.h" #include "Filter.h" @@ -48,9 +49,9 @@ using namespace std; -// ************************************************************************** +//***************************************************************************** // Shift -// ************************************************************************* +//***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- //tShiftDlg::tShiftDlg(JZEventFrame* pEventWindow, JZFilter* pFilter, long unit) @@ -101,9 +102,9 @@ //} -// ************************************************************************** +//***************************************************************************** // Cleanup -// ************************************************************************* +//***************************************************************************** int tCleanupDlg::lowLimit = 48; bool tCleanupDlg::shortenOverlaps = 1; @@ -183,9 +184,9 @@ } -// ************************************************************************** +//***************************************************************************** // SearchReplace -// ************************************************************************* +//***************************************************************************** int tSearchReplaceDlg::frCtrl = 1; int tSearchReplaceDlg::toCtrl = 1; @@ -230,9 +231,9 @@ -// ************************************************************************** +//***************************************************************************** // Transpose -// ************************************************************************* +//***************************************************************************** int tTransposeDlg::Notes = 0; int tTransposeDlg::Scale = gScaleChromatic; @@ -281,9 +282,9 @@ "bool")); } -// ************************************************************************** +//***************************************************************************** // SetChannel -// ************************************************************************* +//***************************************************************************** int tSetChannelDlg::NewChannel = 1; @@ -329,9 +330,9 @@ -// ************************************************************************** +//***************************************************************************** // Velocity -// ************************************************************************* +//***************************************************************************** int tVelocityDlg::FromValue = 64; int tVelocityDlg::ToValue = 0; @@ -380,9 +381,9 @@ -// ************************************************************************** +//***************************************************************************** // Length -// ************************************************************************* +//***************************************************************************** int tLengthDlg::FromValue = 30; int tLengthDlg::ToValue = 0; @@ -441,9 +442,9 @@ -// ************************************************************************** +//***************************************************************************** // seqLength -// ************************************************************************* +//***************************************************************************** double tSeqLengthDlg::scale = 1.0; @@ -484,9 +485,9 @@ } -// ************************************************************************** +//***************************************************************************** // midiDelay -// ************************************************************************* +//***************************************************************************** double tMidiDelayDlg::scale = 0.5; long tMidiDelayDlg::clockDelay = 10; @@ -546,9 +547,9 @@ -// ************************************************************************* +//***************************************************************************** // Delete -// ************************************************************************* +//***************************************************************************** bool tDeleteDlg::LeaveSpace = 1; @@ -585,9 +586,9 @@ //LAST ADDED EVENT -// ************************************************************************** +//***************************************************************************** // Snap -// ************************************************************************* +//***************************************************************************** tSnapDlg::tSnapDlg(JZPianoWindow* pPianoWindow, int* snapptr) : tPropertyListDlg("Snap:quantize cut/paste events"), @@ -631,9 +632,9 @@ } -// ************************************************************************** +//***************************************************************************** // Quantize -// ************************************************************************* +//***************************************************************************** bool tQuantizeDlg::NoteStart = 1; bool tQuantizeDlg::NoteLength = 0; @@ -641,7 +642,8 @@ int tQuantizeDlg::Delay = 0; int tQuantizeDlg::Groove = 0; -tQuantizeDlg::tQuantizeDlg(JZEventFrame *w, JZFilter *f) +//tQuantizeDlg::tQuantizeDlg(JZEventFrame *w, JZFilter *f) +tQuantizeDlg::tQuantizeDlg(JZEventWindow *w, JZFilter *f) : tPropertyListDlg("Quantize" ) //, Steps("steps", gQntSteps, &gQntStep) { @@ -701,9 +703,9 @@ } -// *********************************************************************** +//***************************************************************************** // Event-Dialogue -// *********************************************************************** +//***************************************************************************** class tEventDlg : public tPropertyListDlg { @@ -1440,3 +1442,51 @@ } } +//***************************************************************************** +// MeterChange Dialog +//***************************************************************************** + +int tMeterChangeDlg::Numerator = 4; +int tMeterChangeDlg::Denomiator = 4; +int tMeterChangeDlg::BarNr = 1; + +tMeterChangeDlg::tMeterChangeDlg(JZEventWindow* pEventWindow) + : tPropertyListDlg("Meter Change"), + mpEventWindow(pEventWindow) +{ +} + +void tMeterChangeDlg::AddProperties() +{ + sheet->AddProperty(new wxProperty( + "BarNr", + wxPropertyValue(&BarNr), + "integer"));//JAVE validators here? problem is i dont know which ranges are valid FIXME + sheet->AddProperty(new wxProperty( + "Numerator", + wxPropertyValue(&Numerator), + "integer")); + sheet->AddProperty(new wxProperty( + "Denomiator(2,4,8,16,32)", + wxPropertyValue(&Denomiator), + "integer"));//JAVE should be a integer list instead FIXME +} + +void tMeterChangeDlg::OnCancel() +{ + mpEventWindow->FinishMeterEdit(); +} + +bool tMeterChangeDlg::OnClose() +{ + BarNr += mpEventWindow->GetSong()->GetIntroLength(); + mpEventWindow->GetSong()->SetMeterChange(BarNr, Numerator, Denomiator); + mpEventWindow->Refresh(); + mpEventWindow->FinishMeterEdit(); + return false; +} + +void tMeterChangeDlg::OnHelp() +{ + gpHelpInstance->ShowTopic("Meterchange"); +} Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/Dialogs.h 2009-02-16 05:03:58 UTC (rev 698) @@ -238,7 +238,7 @@ long Quantize(long); - tQuantizeDlg(JZEventFrame *w, JZFilter *f); + tQuantizeDlg(JZEventWindow* w, JZFilter* pFilter); void AddProperties(); //tNamedChoice Steps; bool OnClose(); @@ -253,4 +253,25 @@ int Channel, int Pitch); +//***************************************************************************** +// MeterChange Dialog +//***************************************************************************** +class tMeterChangeDlg : public tPropertyListDlg +{ + public: + + tMeterChangeDlg(JZEventWindow* pEventWindow); + + void AddProperties(); + + virtual bool OnClose(); + virtual void OnCancel(); + virtual void OnHelp(); + + JZEventWindow* mpEventWindow; + static int Numerator; + static int Denomiator; + static int BarNr; +}; + #endif // !defined(JZ_DIALOGS_H) Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/EventFrame.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -23,8 +23,8 @@ //----------------------------------------------------------------------------- BEGIN_EVENT_TABLE(JZEventFrame, wxFrame) - EVT_UPDATE_UI(ID_SHIFT, JZEventFrame::OnUpdateEditShift) - EVT_MENU(ID_SHIFT, JZEventFrame::OnEditShift) + EVT_UPDATE_UI(ID_SHIFT, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_SHIFT, JZEventFrame::OnShift) END_EVENT_TABLE() @@ -47,7 +47,6 @@ mEventsHeight(0), SnapSel(0), MouseAction(0), - mpSettingsDialog(0), MixerForm(0), mpToolBar(0), mpEventWindow(0) @@ -189,7 +188,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::OnUpdateEditShift(wxUpdateUIEvent& Event) +void JZEventFrame::OnUpdateEventsSelected(wxUpdateUIEvent& Event) { if (mpEventWindow) { @@ -203,7 +202,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::OnEditShift(wxCommandEvent& Event) +void JZEventFrame::OnShift(wxCommandEvent& Event) { if (mpEventWindow) { @@ -215,118 +214,123 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnQuantize(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow) { - return; + mpEventWindow->Quantize(); } - - // wxDialogBox *panel = new wxDialogBox(this, "Quantize", FALSE ); - tQuantizeDlg * dlg = new tQuantizeDlg(this, mpFilter); - dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenCleanup() +void JZEventFrame::OnSetChannel(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tCleanupDlg * dlg = new tCleanupDlg(this, mpFilter); + tSetChannelDlg * dlg = new tSetChannelDlg(mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenSearchReplace() +void JZEventFrame::OnTranspose(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tSearchReplaceDlg * dlg = new tSearchReplaceDlg(this, mpFilter); + tTransposeDlg * dlg = new tTransposeDlg(this, mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenSetChannel() +void JZEventFrame::OnDelete(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tSetChannelDlg * dlg = new tSetChannelDlg(mpFilter); + tDeleteDlg * dlg = new tDeleteDlg(this, mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenTranspose() +void JZEventFrame::OnVelocity(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tTransposeDlg * dlg = new tTransposeDlg(this, mpFilter); + tVelocityDlg * dlg = new tVelocityDlg(mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenDelete() +void JZEventFrame::OnLength(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tDeleteDlg * dlg = new tDeleteDlg(this, mpFilter); + tLengthDlg * dlg = new tLengthDlg(this, mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenVelocity() +void JZEventFrame::OnConvertToModulation(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tVelocityDlg * dlg = new tVelocityDlg(mpFilter); - dlg->Create(); + tCmdConvertToModulation cmd(mpFilter); + cmd.Execute(); + Redraw(); } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZEventFrame::MenLength() +void JZEventFrame::OnCleanup(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tLengthDlg * dlg = new tLengthDlg(this, mpFilter); + tCleanupDlg * dlg = new tCleanupDlg(this, mpFilter); dlg->Create(); } //----------------------------------------------------------------------------- -// convert to modulation //----------------------------------------------------------------------------- -void JZEventFrame::MenConvertToModulation() +void JZEventFrame::OnSearchReplace(wxCommandEvent& Event) { if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) { return; } - tCmdConvertToModulation cmd(mpFilter); - cmd.Execute(); - Redraw(); + tSearchReplaceDlg * dlg = new tSearchReplaceDlg(this, mpFilter); + dlg->Create(); } + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventFrame::OnMeterChange(wxCommandEvent& Event) +{ + if (mpEventWindow) + { + mpEventWindow->EditMeter(); + } +} Modified: trunk/jazz/src/EventFrame.h =================================================================== --- trunk/jazz/src/EventFrame.h 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/EventFrame.h 2009-02-16 05:03:58 UTC (rev 698) @@ -85,9 +85,6 @@ JZSnapSelection* SnapSel; tMouseAction* MouseAction; - // Settings-Dialog - wxDialog* mpSettingsDialog; - // Mixer-Dialog wxDialog* MixerForm; @@ -95,23 +92,34 @@ bool OnCharHook(wxKeyEvent& Event); - void OnUpdateEditShift(wxUpdateUIEvent& Event); - void OnEditShift(wxCommandEvent& Event); + void OnUpdateEventsSelected(wxUpdateUIEvent& Event); + void OnShift(wxCommandEvent& Event); + void OnQuantize(wxCommandEvent& Event); - void MenSetChannel(); - void MenTranspose(); - void MenDelete(); - void MenVelocity(); - void MenLength(); - void MenSeqLength(); - void MenMidiDelay(); - void MenConvertToModulation(); - void MenCleanup(); - void MenSearchReplace(); - void MenMeterChange(); + void OnSetChannel(wxCommandEvent& Event); + void OnTranspose(wxCommandEvent& Event); + + void OnDelete(wxCommandEvent& Event); + + void OnVelocity(wxCommandEvent& Event); + + void OnLength(wxCommandEvent& Event); + +// void OnSeqLength(wxCommandEvent& Event); + +// void OnMidiDelay(wxCommandEvent& Event); + + void OnConvertToModulation(wxCommandEvent& Event); + + void OnCleanup(wxCommandEvent& Event); + + void OnSearchReplace(wxCommandEvent& Event); + + void OnMeterChange(wxCommandEvent& Event); + protected: JZToolBar* mpToolBar; Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/EventWindow.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -24,6 +24,7 @@ #include "Command.h" #include "Dialogs/ShiftDialog.h" +#include "Dialogs.h" #include "EventFrame.h" #include "Filter.h" #include "MouseAction.h" @@ -80,7 +81,8 @@ mFromLine(0), mToLine(0), mScrolledX(0), - mScrolledY(0) + mScrolledY(0), + mpSettingsDialog(0) { mpSnapSel = new JZSnapSelection(this); @@ -103,6 +105,7 @@ delete mpFilter; delete mpGreyColor; delete mpGreyBrush; + FinishMeterEdit(); } //----------------------------------------------------------------------------- @@ -149,17 +152,65 @@ //----------------------------------------------------------------------------- // Quantize selected events. //----------------------------------------------------------------------------- -//void JZEventWindow::Quantize() -//{ -// if (AreEventsSelected()) -// { +void JZEventWindow::Quantize() +{ + if (AreEventsSelected()) + { +// wxDialogBox *panel = new wxDialogBox(this, "Quantize", FALSE ); + tQuantizeDlg* pQuantizeDlg = new tQuantizeDlg(this, mpFilter); + pQuantizeDlg->Create(); + // tCmdQuantize QuantizeCommand(mpFilter, SnapClocks(), 0, 0); // QuantizeCommand.Execute(1); // JZProjectManager::Instance()->UpdateAllViews(); -// } -//} + } +} //----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventWindow::EditMeter() +{ + if (!IsEditingMeter()) + { + if (!mpSettingsDialog) + { + mpSettingsDialog = new wxDialog(this, wxID_ANY, "Meter Change"); + } + mpSettingsDialog->Show(true); + } + else + { + mpSettingsDialog->SetFocus(); + } +// tMeterChangeDlg *dlg; +// dlg = new tMeterChangeDlg(this); +// dlg->Create(); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZEventWindow::IsEditingMeter() const +{ + if (mpSettingsDialog) + { + return (mpSettingsDialog->GetHandle() != 0); + } + return false; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEventWindow::FinishMeterEdit() +{ + if (mpSettingsDialog) + { + // Mark the dialog for destruction during idle time processing. + mpSettingsDialog->Destroy(); + mpSettingsDialog = 0; + } +} + +//----------------------------------------------------------------------------- // Description: // Only consider the event portion of the window when computing the virtual // size. Do not consider the static information of the left or top portion of @@ -373,7 +424,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -// void JZEventFrame::OnChar(wxKeyEvent& KeyEvent) +// void JZEventWindow::OnChar(wxKeyEvent& KeyEvent) // { // if (!OnKeyEvent(KeyEvent)) // { @@ -387,88 +438,3 @@ //{ // return EventWin->OnKeyEvent(KeyEvent); //} - -//***************************************************************************** -// MeterChange Dialog -//***************************************************************************** -class tMeterChangeDlg : public tPropertyListDlg -{ - public: - JZEventFrame *EventWin; - static int Numerator; - static int Denomiator; - static int BarNr; - tMeterChangeDlg(JZEventFrame *w); - void AddProperties(); - virtual bool OnClose(); - virtual void OnCancel(); - virtual void OnHelp(); -}; - -int tMeterChangeDlg::Numerator = 4; -int tMeterChangeDlg::Denomiator = 4; -int tMeterChangeDlg::BarNr = 1; - -tMeterChangeDlg::tMeterChangeDlg(JZEventFrame *w) - : tPropertyListDlg("Meter Change") -{ - EventWin = w; -} - -void tMeterChangeDlg::OnCancel() -{ - EventWin->mpSettingsDialog = 0; - //wxForm::OnCancel(); -} - -bool tMeterChangeDlg::OnClose() -{ - BarNr += EventWin->Song->GetIntroLength(); - EventWin->Song->SetMeterChange(BarNr, Numerator, Denomiator); - EventWin->Redraw(); - EventWin->mpSettingsDialog = 0; - //wxForm::OnOk(); - return false; -} - -void tMeterChangeDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Meterchange"); -} - -void tMeterChangeDlg::AddProperties() -{ - // Add(wxMakeFormShort("BarNr:", &BarNr, wxFORM_DEFAULT, 0,0,0,100)); -// Add(wxMakeFormNewLine()); -// Add(wxMakeFormShort("Numerator", &Numerator, wxFORM_DEFAULT, 0,0,0,100)); -// Add(wxMakeFormNewLine()); -// Add(wxMakeFormShort("Denomiator", &Denomiator, wxFORM_DEFAULT, 0,0,0,100)); -// Add(wxMakeFormNewLine()); -// Add(wxMakeFormMessage("Supported Denomiators: 2,4,8,16,32")); -// AssociatePanel(panel); - sheet->AddProperty(new wxProperty( - "BarNr", - wxPropertyValue(&BarNr), - "integer"));//JAVE validators here? problem is i dont know which ranges are valid FIXME - sheet->AddProperty(new wxProperty( - "Numerator", - wxPropertyValue(&Numerator), - "integer")); - sheet->AddProperty(new wxProperty( - "Denomiator(2,4,8,16,32)", - wxPropertyValue(&Denomiator), - "integer"));//JAVE should be a integer list instead FIXME -} - -void JZEventFrame::MenMeterChange() -{ - tMeterChangeDlg *dlg; - if (mpSettingsDialog) - { - mpSettingsDialog->Show(TRUE); - return; - } - // mpSettingsDialog = new wxDialogBox(this, "MeterChange", FALSE ); - dlg = new tMeterChangeDlg(this); - dlg->Create(); -} Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/EventWindow.h 2009-02-16 05:03:58 UTC (rev 698) @@ -28,6 +28,7 @@ class JZFilter; class JZSnapSelection; class JZSong; +class wxDialog; //***************************************************************************** // Description: @@ -55,8 +56,12 @@ void Shift(int Units); -// void Quantize(); + void Quantize(); + void EditMeter(); + bool IsEditingMeter() const; + void FinishMeterEdit(); + void LineText( wxDC& Dc, int x, @@ -120,6 +125,9 @@ int mScrolledX, mScrolledY; + // Settings-Dialog + wxDialog* mpSettingsDialog; + // DECLARE_EVENT_TABLE() }; Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/Makefile.am 2009-02-16 05:03:58 UTC (rev 698) @@ -29,6 +29,7 @@ Dialogs/ShiftDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ +Dialogs/VelocityDialog.cpp \ Dialogs.cpp \ DynamicArray.cpp \ ErrorMessage.cpp \ Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/PianoFrame.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -54,7 +54,6 @@ #define ACT_SETTINGS 5 #define MEN_FILTER 6 -#define MEN_METERCH 8 #define ACT_HELP_MOUSE 9 #define MEN_SETCHAN 14 @@ -186,16 +185,16 @@ EVT_MENU(MEN_CTRL_CHANNEL_AFTER, JZPianoFrame::CtrlChannelAftertouchEdit) // FIXME PAT - We need to bring these back once Dave has figured out what // he's doing with them in relation to the track window. -// EVT_MENU(MEN_CLEANUP, JZPianoFrame::MenCleanup) -// EVT_MENU(MEN_SEARCHREP, JZPianoFrame::MenSearchReplace) -// EVT_MENU(MEN_TRANSP, JZPianoFrame::MenTranspose) -// EVT_MENU(MEN_SETCHAN, JZPianoFrame::MenSetChannel) +// EVT_MENU(MEN_CLEANUP, JZPianoFrame::OnCleanup) +// EVT_MENU(MEN_SEARCHREP, JZPianoFrame::OnSearchReplace) +// EVT_MENU(MEN_TRANSP, JZPianoFrame::OnTranspose) +// EVT_MENU(MEN_SETCHAN, JZPianoFrame::OnSetChannel) EVT_MENU(ID_VELOCITY, JZPianoFrame::OnActivateVelocityDialog) -// EVT_MENU(MEN_LENGTH, JZPianoFrame::MenLength) +// EVT_MENU(MEN_LENGTH, JZPianoFrame::OnLength) EVT_MENU(MEN_MIDIDELAY, JZPianoFrame::OnActivateMidiDelayDialog) EVT_MENU(MEN_SEQLENGTH, JZPianoFrame::OnActivateSequenceLengthDialog) -// EVT_MENU(MEN_CONVERT_TO_MODULATION, JZPianoFrame::MenConvertToModulation) +// EVT_MENU(MEN_CONVERT_TO_MODULATION, JZPianoFrame::OnnConvertToModulation) EVT_MENU(ACT_SETTINGS, JZPianoFrame::OnActivateSettingsDialog) EVT_MENU(MEN_FILTER, JZPianoFrame::OnFilter) EVT_MENU(ID_SNAP, JZPianoFrame::OnSnapDlg) @@ -346,12 +345,12 @@ edit_menu->Append(MEN_CLEANUP, "&Cleanup..."); edit_menu->Append(MEN_SEARCHREP, "&Search Replace..."); - wxMenu *setting_menu = new wxMenu("",wxMENU_TEAROFF); - setting_menu->Append(MEN_FILTER, "&Filter..."); - setting_menu->Append(ACT_SETTINGS, "&Window..."); - setting_menu->Append(MEN_VISIBLE, "&Events..."); - setting_menu->Append(ID_SNAP, "&Snap..."); - setting_menu->Append(MEN_METERCH, "&Meterchange..."); + wxMenu *setting_menu = new wxMenu("", wxMENU_TEAROFF); + setting_menu->Append(MEN_FILTER, "&Filter..."); + setting_menu->Append(ACT_SETTINGS, "&Window..."); + setting_menu->Append(MEN_VISIBLE, "&Events..."); + setting_menu->Append(ID_SNAP, "&Snap..."); + setting_menu->Append(ID_METER_CHANGE, "&Meter Change..."); wxMenu *misc_menu = new wxMenu("",wxMENU_TEAROFF); misc_menu->Append(wxID_UNDO, "&Undo"); @@ -514,7 +513,7 @@ case MEN_VISIBLE: VisibleDialog(); break; -case MEN_METERCH: MenMeterChange(); break; +case ID_METER_CHANGE: OnMeterChange(); break; */ Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -2017,12 +2017,12 @@ { SnapSelStart(Event); - if (mpSnapSel->IsSelected()) - { +// if (mpSnapSel->IsSelected()) +// { // Redraw the whole window instead (inefficient, we should rather // invalidate a rect). Refresh(); - } +// } mpSnapSel->Event(Event); mpMouseAction = mpSnapSel; } Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/Resources.h 2009-02-16 05:03:58 UTC (rev 698) @@ -59,6 +59,8 @@ #define ID_METRONOME_TOGGLE wxID_HIGHEST + 42 #define ID_VELOCITY wxID_HIGHEST + 43 +#define ID_METER_CHANGE wxID_HIGHEST + 45 + #define ID_PLAY wxID_HIGHEST + 50 #define ID_PLAY_LOOP wxID_HIGHEST + 51 #define ID_RECORD wxID_HIGHEST + 52 Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/src/TrackFrame.cpp 2009-02-16 05:03:58 UTC (rev 698) @@ -268,18 +268,18 @@ // Miscellaneous Menu is Stupid. // Now it's a View Menu misc_menu = new wxMenu; - misc_menu->Append(MEN_TMERGE, "Mer&ge Tracks..."); - misc_menu->Append(MEN_TSPLIT, "&Split Tracks..."); - misc_menu->Append(MEN_METERCH, "&Meterchange..."); - misc_menu->Append(MEN_RESET, "&Reset Midi"); - misc_menu->Append(MEN_HARMONY, "&Harmony Browser..."); - misc_menu->Append(MEN_RHYTHM, "Random R&hythm..."); - misc_menu->Append(MEN_SHUFFLE, "Random Sh&uffle..."); - misc_menu->Append(MEN_GENMELDY, "Random Melod&y..."); - misc_menu->Append(MEN_ARPEGGIO, "Random Arpeggio..."); - misc_menu->Append(MEN_MAPPER, "Ma&pper..."); - misc_menu->Append(MEN_EVENTLIST, "Event &List..."); - misc_menu->Append(MEN_COPYRIGHT,"&Set Music Copyright..."); + misc_menu->Append(MEN_TMERGE, "Mer&ge Tracks..."); + misc_menu->Append(MEN_TSPLIT, "&Split Tracks..."); + misc_menu->Append(ID_METER_CHANGE, "&Meter Change..."); + misc_menu->Append(MEN_RESET, "&Reset Midi"); + misc_menu->Append(MEN_HARMONY, "&Harmony Browser..."); + misc_menu->Append(MEN_RHYTHM, "Random R&hythm..."); + misc_menu->Append(MEN_SHUFFLE, "Random Sh&uffle..."); + misc_menu->Append(MEN_GENMELDY, "Random Melod&y..."); + misc_menu->Append(MEN_ARPEGGIO, "Random Arpeggio..."); + misc_menu->Append(MEN_MAPPER, "Ma&pper..."); + misc_menu->Append(MEN_EVENTLIST, "Event &List..."); + misc_menu->Append(MEN_COPYRIGHT, "&Set Music Copyright..."); #endif mpToolsMenu = new wxMenu; Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-16 05:03:58 UTC (rev 698) @@ -890,6 +890,14 @@ RelativePath="..\src\Dialogs\TrackDialog.h" > </File> + <File + RelativePath="..\src\Dialogs\VelocityDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\VelocityDialog.h" + > + </File> </Filter> </Files> <Globals> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-01-22 02:24:58 UTC (rev 697) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-16 05:03:58 UTC (rev 698) @@ -908,6 +908,14 @@ RelativePath="..\src\Dialogs\TrackDialog.h" > </File> + <File + RelativePath="..\src\Dialogs\VelocityDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\VelocityDialog.h" + > + </File> </Filter> </Files> <Globals> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-16 22:30:24
|
Revision: 704 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=704&view=rev Author: pstieber Date: 2009-02-16 22:30:19 +0000 (Mon, 16 Feb 2009) Log Message: ----------- 1. Implemented a new version of the delete dialog box. 2. Updated several resource IDs. 3. Added wxWidgets event table entries in the event frame base class for several menu entries. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventWindow.cpp trunk/jazz/src/Makefile.am trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/Resources.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/DeleteDialog.cpp trunk/jazz/src/Dialogs/DeleteDialog.h Added: trunk/jazz/src/Dialogs/DeleteDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/DeleteDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/DeleteDialog.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -0,0 +1,93 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "DeleteDialog.h" + +#include "Globals.h" +#include "Help.h" + +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/sizer.h> + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZDeleteDialog, wxDialog) + + EVT_BUTTON(wxID_HELP, JZDeleteDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZDeleteDialog::JZDeleteDialog(wxWindow* pParent, bool& LeaveSpace) + : wxDialog(pParent, wxID_ANY, wxString("Delete Events")), + mLeaveSpace(LeaveSpace), + mpLeaveSpaceCheckBox(0) +{ + mpLeaveSpaceCheckBox = new wxCheckBox(this, wxID_ANY, "Leave Space"); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + pTopSizer->Add(mpLeaveSpaceCheckBox, 0, wxALIGN_CENTER | wxALL, 10); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZDeleteDialog::TransferDataToWindow() +{ + mpLeaveSpaceCheckBox->SetValue(mLeaveSpace); + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZDeleteDialog::TransferDataFromWindow() +{ + mLeaveSpace = mpLeaveSpaceCheckBox->GetValue(); + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZDeleteDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Delete"); +} Property changes on: trunk/jazz/src/Dialogs/DeleteDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/DeleteDialog.h =================================================================== --- trunk/jazz/src/Dialogs/DeleteDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/DeleteDialog.h 2009-02-16 22:30:19 UTC (rev 704) @@ -0,0 +1,53 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_DELETEDIALOG_H +#define JZ_DELETEDIALOG_H + +#include <wx/dialog.h> + +class wxCheckBox; + +//***************************************************************************** +//***************************************************************************** +class JZDeleteDialog : public wxDialog +{ + public: + + JZDeleteDialog(wxWindow* pParent, bool& LeaveSpace); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnHelp(wxCommandEvent& Event); + + private: + + bool& mLeaveSpace; + + wxCheckBox* mpLeaveSpaceCheckBox; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_DELETEDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/DeleteDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/Dialogs.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -548,45 +548,6 @@ //***************************************************************************** -// Delete -//***************************************************************************** - -bool tDeleteDlg::LeaveSpace = 1; - -tDeleteDlg::tDeleteDlg(JZEventWindow* w, JZFilter *f) -: tPropertyListDlg("Delete" ) -{ - Filter = f; -} - - -bool tDeleteDlg::OnClose() -{ - tCmdErase cmd(Filter, LeaveSpace); - cmd.Execute(); - - JZProjectManager::Instance()->UpdateAllViews(); - -// tPropertyListDlg::OnClose(); - return false; -} - -void tDeleteDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Delete"); -} - -void tDeleteDlg::AddProperties() -{ -// Add(wxMakeFormBool("Leave Space", &LeaveSpace)); -// AssociatePanel(panel); - sheet->AddProperty(new wxProperty("Leave Space", wxPropertyValue((bool*)&LeaveSpace), "bool")); -} - -//LAST ADDED EVENT - - -//***************************************************************************** // Snap //***************************************************************************** Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/Dialogs.h 2009-02-16 22:30:19 UTC (rev 704) @@ -188,20 +188,6 @@ void OnHelp(); }; -class tDeleteDlg : public tPropertyListDlg -{ - JZFilter *Filter; - - public: - static bool LeaveSpace; // 1 - - tDeleteDlg(JZEventWindow* w, JZFilter *f); - void AddProperties(); - bool OnClose(); - void OnHelp(); -}; - - class tSnapDlg : public tPropertyListDlg { public: Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/EventFrame.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -19,6 +19,24 @@ EVT_UPDATE_UI(ID_SHIFT, JZEventFrame::OnUpdateEventsSelected) EVT_MENU(ID_SHIFT, JZEventFrame::OnShift) + EVT_UPDATE_UI(ID_QUANTIZE, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_QUANTIZE, JZEventFrame::OnQuantize) + + EVT_UPDATE_UI(ID_SET_CHANNEL, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_SET_CHANNEL, JZEventFrame::OnSetChannel) + + EVT_UPDATE_UI(ID_TRANSPOSE, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_TRANSPOSE, JZEventFrame::OnTranspose) + + EVT_UPDATE_UI(wxID_DELETE, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(wxID_DELETE, JZEventFrame::OnDelete) + + EVT_UPDATE_UI(ID_VELOCITY, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_VELOCITY, JZEventFrame::OnVelocity) + + EVT_UPDATE_UI(ID_LENGTH, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_VELOCITY, JZEventFrame::OnLength) + END_EVENT_TABLE() //----------------------------------------------------------------------------- @@ -95,7 +113,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnShift(wxCommandEvent& Event) { - if (mpEventWindow) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Shift(16); } @@ -105,7 +123,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnQuantize(wxCommandEvent& Event) { - if (mpEventWindow) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Quantize(); } @@ -115,7 +133,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnSetChannel(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->SetChannel(); } @@ -125,7 +143,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnTranspose(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Transpose(); } @@ -135,7 +153,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnDelete(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Delete(); } @@ -145,7 +163,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnVelocity(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Velocity(); } @@ -155,7 +173,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnLength(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Length(); } @@ -165,7 +183,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnConvertToModulation(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->ConvertToModulation(); } @@ -175,7 +193,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnCleanup(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->Cleanup(); } @@ -185,7 +203,7 @@ //----------------------------------------------------------------------------- void JZEventFrame::OnSearchReplace(wxCommandEvent& Event) { - if (!mpEventWindow || !mpEventWindow->AreEventsSelected()) + if (mpEventWindow && mpEventWindow->AreEventsSelected()) { mpEventWindow->SearchReplace(); } Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/EventWindow.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -23,6 +23,7 @@ #include "EventWindow.h" #include "Command.h" +#include "Dialogs/DeleteDialog.h" #include "Dialogs/ShiftDialog.h" #include "Dialogs.h" #include "EventFrame.h" @@ -188,8 +189,16 @@ //----------------------------------------------------------------------------- void JZEventWindow::Delete() { - tDeleteDlg * dlg = new tDeleteDlg(this, mpFilter); - dlg->Create(); + bool LeaveSpace = true; + + JZDeleteDialog DeleteDialog(this, LeaveSpace); + + if (DeleteDialog.ShowModal() == wxID_OK) + { + tCmdErase EraseCommand(mpFilter, LeaveSpace); + EraseCommand.Execute(); + JZProjectManager::Instance()->UpdateAllViews(); + } } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/Makefile.am 2009-02-16 22:30:19 UTC (rev 704) @@ -22,6 +22,7 @@ DeprecatedWx/prop.cpp \ DeprecatedWx/propform.cpp \ DeprecatedWx/proplist.cpp \ +Dialogs/DeleteDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ Dialogs/KeyOnDialog.cpp \ Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/PianoFrame.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -56,11 +56,8 @@ #define MEN_FILTER 6 #define ACT_HELP_MOUSE 9 -#define MEN_SETCHAN 14 -#define MEN_TRANSP 15 #define MEN_LERI 18 #define MEN_UPDN 19 -#define MEN_LENGTH 20 #define MEN_VISIBLE 22 @@ -72,11 +69,9 @@ #define MEN_CTRL_MODUL 28 #define MEN_GUITAR 29 -#define MEN_CLEANUP 31 #define MEN_RESET 36 #define MEN_VIS_ALL_TRK 37 -#define MEN_SEARCHREP 38 #define ACT_CLOSE 41 #define MEN_CTRL_TEMPO 42 @@ -185,12 +180,12 @@ EVT_MENU(MEN_CTRL_CHANNEL_AFTER, JZPianoFrame::CtrlChannelAftertouchEdit) // FIXME PAT - We need to bring these back once Dave has figured out what // he's doing with them in relation to the track window. -// EVT_MENU(MEN_CLEANUP, JZPianoFrame::OnCleanup) -// EVT_MENU(MEN_SEARCHREP, JZPianoFrame::OnSearchReplace) -// EVT_MENU(MEN_TRANSP, JZPianoFrame::OnTranspose) -// EVT_MENU(MEN_SETCHAN, JZPianoFrame::OnSetChannel) +// EVT_MENU(ID_CLEANUP, JZPianoFrame::OnCleanup) +// EVT_MENU(ID_SEARCH_AND_REPLACE, JZPianoFrame::OnSearchReplace) +// EVT_MENU(ID_TRANSPOSE, JZPianoFrame::OnTranspose) +// EVT_MENU(ID_SET_CHANNEL, JZPianoFrame::OnSetChannel) EVT_MENU(ID_VELOCITY, JZPianoFrame::OnActivateVelocityDialog) -// EVT_MENU(MEN_LENGTH, JZPianoFrame::OnLength) +// EVT_MENU(ID_LENGTH, JZPianoFrame::OnLength) EVT_MENU(MEN_MIDIDELAY, JZPianoFrame::OnActivateMidiDelayDialog) EVT_MENU(MEN_SEQLENGTH, JZPianoFrame::OnActivateSequenceLengthDialog) @@ -331,10 +326,10 @@ edit_menu->Append(wxID_CUT, "&Cut"); edit_menu->Append(ID_SHIFT, "&Shift..."); edit_menu->Append(ID_QUANTIZE, "&Quantize..."); - edit_menu->Append(MEN_SETCHAN, "&Set MIDI Channel..."); - edit_menu->Append(MEN_TRANSP, "&Transpose..."); + edit_menu->Append(ID_SET_CHANNEL, "&Set MIDI Channel..."); + edit_menu->Append(ID_TRANSPOSE, "&Transpose..."); edit_menu->Append(ID_VELOCITY, "&Velocity..."); - edit_menu->Append(MEN_LENGTH, "&Length..."); + edit_menu->Append(ID_LENGTH, "&Length..."); edit_menu->Append(MEN_SEQLENGTH, "&Sequence Length..."); edit_menu->Append(MEN_MIDIDELAY, "&Midi Delay..."); @@ -342,8 +337,8 @@ edit_menu->Append(MEN_LERI, "&Left <-> Right"); edit_menu->Append(MEN_UPDN, "&Up <-> Down"); - edit_menu->Append(MEN_CLEANUP, "&Cleanup..."); - edit_menu->Append(MEN_SEARCHREP, "&Search Replace..."); + edit_menu->Append(ID_CLEANUP, "&Cleanup..."); + edit_menu->Append(ID_SEARCH_AND_REPLACE, "&Search Replace..."); wxMenu *setting_menu = new wxMenu("", wxMENU_TEAROFF); setting_menu->Append(MEN_FILTER, "&Filter..."); Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/Resources.h 2009-02-16 22:30:19 UTC (rev 704) @@ -46,21 +46,25 @@ #define ID_TRIM wxID_HIGHEST + 30 #define ID_QUANTIZE wxID_HIGHEST + 31 -#define ID_SHIFT wxID_HIGHEST + 32 -#define ID_SHIFT_LEFT wxID_HIGHEST + 33 -#define ID_SHIFT_RIGHT wxID_HIGHEST + 34 -#define ID_SNAP wxID_HIGHEST + 35 -#define ID_SNAP_8 wxID_HIGHEST + 36 -#define ID_SNAP_8D wxID_HIGHEST + 37 -#define ID_SNAP_16 wxID_HIGHEST + 38 -#define ID_SNAP_16D wxID_HIGHEST + 39 -#define ID_MIXER wxID_HIGHEST + 40 -#define ID_PIANOWIN wxID_HIGHEST + 41 -#define ID_METRONOME_TOGGLE wxID_HIGHEST + 42 -#define ID_VELOCITY wxID_HIGHEST + 43 +#define ID_SET_CHANNEL wxID_HIGHEST + 32 +#define ID_SHIFT wxID_HIGHEST + 33 +#define ID_SHIFT_LEFT wxID_HIGHEST + 34 +#define ID_SHIFT_RIGHT wxID_HIGHEST + 35 +#define ID_SNAP wxID_HIGHEST + 36 +#define ID_SNAP_8 wxID_HIGHEST + 37 +#define ID_SNAP_8D wxID_HIGHEST + 38 +#define ID_SNAP_16 wxID_HIGHEST + 39 +#define ID_SNAP_16D wxID_HIGHEST + 40 +#define ID_MIXER wxID_HIGHEST + 41 +#define ID_PIANOWIN wxID_HIGHEST + 42 +#define ID_METRONOME_TOGGLE wxID_HIGHEST + 43 +#define ID_VELOCITY wxID_HIGHEST + 44 +#define ID_LENGTH wxID_HIGHEST + 45 +#define ID_METER_CHANGE wxID_HIGHEST + 46 +#define ID_TRANSPOSE wxID_HIGHEST + 47 +#define ID_CLEANUP wxID_HIGHEST + 48 +#define ID_SEARCH_AND_REPLACE wxID_HIGHEST + 49 -#define ID_METER_CHANGE wxID_HIGHEST + 45 - #define ID_PLAY wxID_HIGHEST + 50 #define ID_PLAY_LOOP wxID_HIGHEST + 51 #define ID_RECORD wxID_HIGHEST + 52 Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/src/TrackFrame.cpp 2009-02-16 22:30:19 UTC (rev 704) @@ -238,14 +238,14 @@ mpEditMenu->AppendSeparator(); -// mpEditMenu->Append(ID_QUANTIZE, "&Quantize..."); -// mpEditMenu->Append(MEN_SETCHAN, "&Set MIDI Channel..."); -// mpEditMenu->Append(MEN_TRANSP, "&Transpose..."); -// mpEditMenu->Append(ID_VELOCITY, "&Velocity..."); -// mpEditMenu->Append(MEN_LENGTH, "&Length..."); + mpEditMenu->Append(ID_QUANTIZE, "&Quantize..."); + mpEditMenu->Append(ID_SET_CHANNEL, "&Set MIDI Channel..."); + mpEditMenu->Append(ID_TRANSPOSE, "&Transpose..."); + mpEditMenu->Append(ID_VELOCITY, "&Velocity..."); + mpEditMenu->Append(ID_LENGTH, "&Length..."); mpEditMenu->Append(ID_SHIFT, "Shi&ft..."); -// mpEditMenu->Append(MEN_CLEANUP, "C&leanup..."); -// mpEditMenu->Append(MEN_SEARCHREP, "Search Re&place..."); + mpEditMenu->Append(ID_CLEANUP, "C&leanup..."); + mpEditMenu->Append(ID_SEARCH_AND_REPLACE, "Search Re&place..."); mpEditMenu->AppendSeparator(); Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-16 22:30:19 UTC (rev 704) @@ -835,6 +835,14 @@ Name="Dialog Source Files" > <File + RelativePath="..\src\Dialogs\DeleteDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\DeleteDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\FilterDialog.cpp" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-16 21:39:33 UTC (rev 703) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-16 22:30:19 UTC (rev 704) @@ -853,6 +853,14 @@ Name="Dialog Source Files" > <File + RelativePath="..\src\Dialogs\DeleteDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\DeleteDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\FilterDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 01:13:20
|
Revision: 709 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=709&view=rev Author: pstieber Date: 2009-02-17 01:13:18 +0000 (Tue, 17 Feb 2009) Log Message: ----------- 1. Removed the ResourceDialog.cpp/.h code from the build. 2. Used the JEValueAlterationMode enumeration in the velocity and length commands. Also made the data members in the velocity and length commands private. 3. Removed the old velocity dialog. 4. Changed include paths in the delete dialog source file. 5. Implemented a new velocity dialog and started using it in the event window.. Modified Paths: -------------- trunk/jazz/src/Command.cpp trunk/jazz/src/Command.h trunk/jazz/src/Dialogs/DeleteDialog.cpp trunk/jazz/src/Dialogs/VelocityDialog.cpp trunk/jazz/src/Dialogs/VelocityDialog.h trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/Makefile.am trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/PianoWindow.cpp trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Command.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -475,12 +475,16 @@ // tCmdVelocity // ************************************************************************ -tCmdVelocity::tCmdVelocity(JZFilter* pFilter, int from, int to, int m) - : tCommand(pFilter) +tCmdVelocity::tCmdVelocity( + JZFilter* pFilter, + int FromValue, + int ToValue, + JEValueAlterationMode Mode) + : tCommand(pFilter), + mFromValue(FromValue), + mToValue(ToValue), + mMode(Mode) { - FromValue = from; - ToValue = to; - Mode = m; } void tCmdVelocity::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) @@ -490,23 +494,27 @@ if (pEvent->IsKeyOn() != 0) { pKeyOn = (tKeyOn *)pEvent->Copy(); - long val = 0; - if (ToValue <= 0) - val = FromValue; + int Value = 0; + if (mToValue <= 0) + { + Value = mFromValue; + } else - val = Interpolate(pKeyOn->GetClock(), FromValue, ToValue); - switch (Mode) { - case 0: + Value = Interpolate(pKeyOn->GetClock(), mFromValue, mToValue); + } + switch (mMode) + { + case eSetValues: break; - case 1: - val = pKeyOn->GetVelocity() + val; + case eAddValues: + Value = pKeyOn->GetVelocity() + Value; break; - case 2: - val = pKeyOn->GetVelocity() - val; + case eSubtractValues: + Value = pKeyOn->GetVelocity() - Value; break; } - pKeyOn->SetVelocity(val < 1 ? 1 : (val > 127 ? 127 : val)); + pKeyOn->SetVelocity(Value < 1 ? 1 : (Value > 127 ? 127 : Value)); pTrack->Kill(pEvent); pTrack->Put(pKeyOn); } @@ -516,12 +524,16 @@ // tCmdLength // ************************************************************************ -tCmdLength::tCmdLength(JZFilter* pFilter, int from, int to, int m) - : tCommand(pFilter) +tCmdLength::tCmdLength( + JZFilter* pFilter, + int FromValue, + int ToValue, + JEValueAlterationMode Mode) + : tCommand(pFilter), + mFromValue(FromValue), + mToValue(ToValue), + mMode(Mode) { - FromValue = from; - ToValue = to; - Mode = m; } void tCmdLength::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) @@ -531,24 +543,28 @@ if (pEvent->IsKeyOn() != 0) { pKeyOn = (tKeyOn *)pEvent->Copy(); - long val = 0; - if (ToValue <= 0) - val = FromValue; + int Value = 0; + if (mToValue <= 0) + { + Value = mFromValue; + } else - val = Interpolate(pKeyOn->GetClock(), FromValue, ToValue); - switch (Mode) { - case 0: + Value = Interpolate(pKeyOn->GetClock(), mFromValue, mToValue); + } + switch (mMode) + { + case eSetValues: break; - case 1: - val = pKeyOn->GetEventLength() + val; + case eAddValues: + Value = pKeyOn->GetEventLength() + Value; break; - case 2: - val = pKeyOn->GetEventLength() - val; + case eSubtractValues: + Value = pKeyOn->GetEventLength() - Value; break; } - pKeyOn->SetLength(val < 1 ? 1 : val); + pKeyOn->SetLength(Value < 1 ? 1 : Value); pTrack->Kill(pEvent); pTrack->Put(pKeyOn); } @@ -558,8 +574,8 @@ // ************************************************************************ // tCmdSeqLength -// JAVE this command is supposed to stretch/contract a sequence of events in time -// by factor "scale" from starting point "startClock" +// This command is supposed to stretch/contract a sequence of events in +// time by factor "scale" from starting point "startClock" // ************************************************************************ tCmdSeqLength::tCmdSeqLength(JZFilter* pFilter, double scale) @@ -1029,7 +1045,7 @@ tKeyOn* pKeyOn = (tKeyOn *)pEvent->Copy(); int n_th = 0; - // the n'th key from bottom .. + // the n'th key from bottom for (i = 0; i <= pKeyOn->GetKey(); i++) { n_th += Keys[i]; Modified: trunk/jazz/src/Command.h =================================================================== --- trunk/jazz/src/Command.h 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Command.h 2009-02-17 01:13:18 UTC (rev 709) @@ -23,6 +23,8 @@ #ifndef JZ_COMMAND_H #define JZ_COMMAND_H +#include "CommandUtilities.h" + class JZFilter; class JZEvent; class JZTrack; @@ -107,9 +109,19 @@ class tCmdVelocity : public tCommand { public: - int FromValue, ToValue, Mode; - tCmdVelocity(JZFilter* pFilter, int From, int To, int Mode); + + tCmdVelocity( + JZFilter* pFilter, + int From, + int To, + JEValueAlterationMode Mode); + virtual void ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent); + + private: + + int mFromValue, mToValue; + JEValueAlterationMode mMode; }; //***************************************************************************** @@ -117,9 +129,19 @@ class tCmdLength : public tCommand { public: - int FromValue, ToValue, Mode; - tCmdLength(JZFilter* pFilter, int From, int To, int Mode); + + tCmdLength( + JZFilter* pFilter, + int FromValue, + int ToValue, + JEValueAlterationMode Mode); + virtual void ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent); + + private: + + int mFromValue, mToValue; + JEValueAlterationMode mMode; }; //***************************************************************************** Modified: trunk/jazz/src/Dialogs/DeleteDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/DeleteDialog.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Dialogs/DeleteDialog.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -20,8 +20,8 @@ #include "DeleteDialog.h" -#include "Globals.h" -#include "Help.h" +#include "../Globals.h" +#include "../Help.h" #include <wx/button.h> #include <wx/checkbox.h> Modified: trunk/jazz/src/Dialogs/VelocityDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Dialogs/VelocityDialog.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -1,5 +1,229 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + #include "VelocityDialog.h" -JZVelocityDialog::JZVelocityDialog() +#include "../Globals.h" +#include "../Help.h" +#include "../Knob.h" +#include "../Resources.h" + +#include <wx/button.h> +#include <wx/radiobox.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +#include <sstream> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZVelocityDialog, wxDialog) + + EVT_KNOB_CHANGED( + IDC_KB_VELOCITY_START, + JZVelocityDialog::OnVelocityStartChange) + + EVT_KNOB_CHANGED( + IDC_KB_VELOCITY_STOP, + JZVelocityDialog::OnVelocityStopChange) + + EVT_BUTTON(wxID_HELP, JZVelocityDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZVelocityDialog::JZVelocityDialog( + wxWindow* pParent, + int& FromValue, + int& ToValue, + JEValueAlterationMode& Mode) + : wxDialog(pParent, wxID_ANY, wxString("Velocity")), + mFromValue(FromValue), + mToValue(ToValue), + mMode(Mode), + mpVelocityStartKnob(0), + mpVelocityStartValue(0), + mpVelocityStopKnob(0), + mpVelocityStopValue(0), + mpModeRadioBox(0) { + mpVelocityStartKnob = new JZKnob(this, IDC_KB_VELOCITY_START, 0, 0, 127); + mpVelocityStartValue = new wxStaticText(this, wxID_ANY, "000"); + + mpVelocityStopKnob = new JZKnob(this, IDC_KB_VELOCITY_STOP, 0, 0, 127); + mpVelocityStopValue = new wxStaticText(this, wxID_ANY, "000"); + + wxString Choices[] = + { + "Set Values", + "Add To Value", + "Subtract From Values" + }; + mpModeRadioBox = new wxRadioBox( + this, + wxID_ANY, + "Value Application Mode", + wxDefaultPosition, + wxDefaultSize, + 3, + Choices, + 1, + wxRA_SPECIFY_COLS); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + wxFlexGridSizer* pFlexGridSizer = new wxFlexGridSizer(2, 3, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Start Velocity:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpVelocityStartValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpVelocityStartKnob, 0, wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Stop Velocity:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpVelocityStopValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpVelocityStopKnob, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER); + + pTopSizer->Add( + mpModeRadioBox, + 0, + wxALIGN_CENTER | wxALL, + 5); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); } + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZVelocityDialog::TransferDataToWindow() +{ + ostringstream Oss; + + Oss << mFromValue; + mpVelocityStartValue->SetLabel(Oss.str().c_str()); + + mpVelocityStartKnob->SetValue(mFromValue); + + Oss.str(""); + Oss << mToValue; + mpVelocityStopValue->SetLabel(Oss.str().c_str()); + + mpVelocityStopKnob->SetValue(mToValue); + + switch (mMode) + { + case eSetValues: + mpModeRadioBox->SetSelection(0); + break; + case eAddValues: + mpModeRadioBox->SetSelection(1); + break; + case eSubtractValues: + mpModeRadioBox->SetSelection(2); + break; + } + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZVelocityDialog::TransferDataFromWindow() +{ + mFromValue = mpVelocityStartKnob->GetValue(); + + mToValue = mpVelocityStopKnob->GetValue(); + + int Selection = mpModeRadioBox->GetSelection(); + if (Selection == 1) + { + mMode = eAddValues; + } + else if (Selection == 2) + { + mMode = eSubtractValues; + } + else + { + mMode = eSetValues; + } + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZVelocityDialog::OnVelocityStartChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpVelocityStartValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZVelocityDialog::OnVelocityStopChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpVelocityStopValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZVelocityDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Velocity"); +} Modified: trunk/jazz/src/Dialogs/VelocityDialog.h =================================================================== --- trunk/jazz/src/Dialogs/VelocityDialog.h 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Dialogs/VelocityDialog.h 2009-02-17 01:13:18 UTC (rev 709) @@ -1,14 +1,72 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + #ifndef JZ_VELOCITYDIALOG_H #define JZ_VELOCITYDIALOG_H +#include "../CommandUtilities.h" + #include <wx/dialog.h> +class JZKnob; +class JZKnobEvent; +class wxStaticText; + +//***************************************************************************** +//***************************************************************************** class JZVelocityDialog : public wxDialog { public: - JZVelocityDialog(); + JZVelocityDialog( + wxWindow* pParent, + int& FromValue, + int& ToValue, + JEValueAlterationMode& Mode); + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnVelocityStartChange(JZKnobEvent& Event); + + void OnVelocityStopChange(JZKnobEvent& Event); + + void OnHelp(wxCommandEvent& Event); + + private: + + int& mFromValue; + int& mToValue; + JEValueAlterationMode& mMode; + + JZKnob* mpVelocityStartKnob; + wxStaticText* mpVelocityStartValue; + JZKnob* mpVelocityStopKnob; + wxStaticText* mpVelocityStopValue; + + wxRadioBox* mpModeRadioBox; + + DECLARE_EVENT_TABLE(); }; #endif // !defined(JZ_VELOCITYDIALOG_H) Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Dialogs.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -331,64 +331,13 @@ //***************************************************************************** -// Velocity -//***************************************************************************** - -int tVelocityDlg::FromValue = 64; -int tVelocityDlg::ToValue = 0; -int tVelocityDlg::Mode = 0; - - -tVelocityDlg::tVelocityDlg(JZFilter *f) -: tPropertyListDlg( "Velocity" ) -{ - Filter = f; - Song = f->GetSong(); -} - - -bool tVelocityDlg::OnClose() -{ - tCmdVelocity cmd(Filter, FromValue, ToValue, Mode); - cmd.Execute(); - return false; -} - -void tVelocityDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Velocity"); -} - -void tVelocityDlg::AddProperties() -{ - sheet->AddProperty(new wxProperty( - "Start", - wxPropertyValue(&FromValue), - "integer", - new wxIntegerListValidator(0, 127))); - sheet->AddProperty(new wxProperty( - "Stop", - wxPropertyValue(&ToValue), - "integer", - new wxIntegerListValidator(0, 127))); - sheet->AddProperty(new wxProperty( - "Mode", - tNamedValueListValue(&Mode, gModes), - "props", - new tNamedValueListValidator(gModes))); -} - - - - -//***************************************************************************** // Length //***************************************************************************** int tLengthDlg::FromValue = 30; int tLengthDlg::ToValue = 0; -int tLengthDlg::Mode; +JEValueAlterationMode tLengthDlg::Mode; tLengthDlg::tLengthDlg(JZEventWindow* w, JZFilter *f) : tPropertyListDlg("Length") @@ -433,11 +382,11 @@ wxPropertyValue(&ToValue), "integer", new wxIntegerListValidator(0, Song->GetTicksPerQuarter() * 4))); - sheet->AddProperty(new wxProperty( - "Mode", - tNamedValueListValue(&Mode, gModes), - "props", - new tNamedValueListValidator(gModes))); +// sheet->AddProperty(new wxProperty( +// "Mode", +// tNamedValueListValue(&Mode, gModes), +// "props", +// new tNamedValueListValidator(gModes))); } Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Dialogs.h 2009-02-17 01:13:18 UTC (rev 709) @@ -23,6 +23,7 @@ #ifndef JZ_DIALOGS_H #define JZ_DIALOGS_H +#include "CommandUtilities.h" #include "PropertyListDialog.h" class JZPianoWindow; @@ -119,29 +120,13 @@ void OnHelp(); }; -// Velocity -class tVelocityDlg : public tPropertyListDlg -{ - public: - - static int FromValue, ToValue, Mode; - static char *mode_str; - - JZFilter *Filter; - JZSong *Song; - - tVelocityDlg(JZFilter *f); - void AddProperties(); - bool OnClose(); - void OnHelp(); -}; - // Length class tLengthDlg : public tPropertyListDlg { public: - static int FromValue, ToValue, Mode; + static int FromValue, ToValue; + static JEValueAlterationMode Mode; static char *mode_str; JZFilter *Filter; Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/EventWindow.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -25,6 +25,7 @@ #include "Command.h" #include "Dialogs/DeleteDialog.h" #include "Dialogs/ShiftDialog.h" +#include "Dialogs/VelocityDialog.h" #include "Dialogs.h" #include "EventFrame.h" #include "Filter.h" @@ -205,8 +206,16 @@ //----------------------------------------------------------------------------- void JZEventWindow::Velocity() { - tVelocityDlg * dlg = new tVelocityDlg(mpFilter); - dlg->Create(); + int FromValue = 64; + int ToValue = 0; + JEValueAlterationMode Mode = eSetValues; + + JZVelocityDialog VelocityDialog(this, FromValue, ToValue, Mode); + if (VelocityDialog.ShowModal() == wxID_OK) + { + tCmdVelocity VelocityCommand(mpFilter, FromValue, ToValue, Mode); + VelocityCommand.Execute(); + } } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/Makefile.am 2009-02-17 01:13:18 UTC (rev 709) @@ -71,7 +71,6 @@ Random.cpp \ RecordingInfo.cpp \ Rectangle.cpp \ -ResourceDialog.cpp \ Rhythm.cpp \ SampleCommand.cpp \ Sample.cpp \ @@ -152,7 +151,6 @@ Random.cpp \ RecordingInfo.cpp \ Rectangle.cpp \ -ResourceDialog.cpp \ Rhythm.cpp \ SampleCommand.cpp \ Sample.cpp \ @@ -237,7 +235,6 @@ Random.h \ RecordingInfo.h \ Rectangle.h \ -ResourceDialog.h \ Resources.h \ Rhythm.h \ SampleCommand.h \ Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/PianoFrame.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -37,7 +37,6 @@ #include "Player.h" #include "GuitarFrame.h" #include "ToolBar.h" -#include "ResourceDialog.h" #include "Help.h" #include "Rectangle.h" Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-17 01:13:18 UTC (rev 709) @@ -34,7 +34,6 @@ #include "PianoFrame.h" #include "Player.h" #include "ProjectManager.h" -#include "ResourceDialog.h" #include "Resources.h" #include "SelectControllerDialog.h" #include "Song.h" @@ -3131,6 +3130,7 @@ //----------------------------------------------------------------------------- void JZPianoWindow::ActivateSettingsDialog() { +/* jppResourceDialog Dialog(this, "windowSettings"); Dialog.Attach("use_colours", &mUseColors); @@ -3142,6 +3142,7 @@ SetScrollRanges(); Refresh(); } +*/ } //----------------------------------------------------------------------------- @@ -3150,6 +3151,7 @@ //----------------------------------------------------------------------------- void JZPianoWindow::ActivateMidiDelayDialog() { +/* if (!EventsSelected()) { return; @@ -3173,12 +3175,14 @@ SetScrollRanges(); Refresh(); } +*/ } //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- void JZPianoWindow::ActivateSequenceLengthDialog() { +/* if (!EventsSelected()) { return; @@ -3198,4 +3202,5 @@ SetScrollRanges(); Refresh(); } +*/ } Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 01:13:18 UTC (rev 709) @@ -638,14 +638,6 @@ > </File> <File - RelativePath="..\src\ResourceDialog.cpp" - > - </File> - <File - RelativePath="..\src\ResourceDialog.h" - > - </File> - <File RelativePath="..\src\Resources.h" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 00:51:53 UTC (rev 708) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 01:13:18 UTC (rev 709) @@ -637,14 +637,6 @@ > </File> <File - RelativePath="..\src\ResourceDialog.cpp" - > - </File> - <File - RelativePath="..\src\ResourceDialog.h" - > - </File> - <File RelativePath="..\src\Resources.h" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 02:25:15
|
Revision: 714 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=714&view=rev Author: pstieber Date: 2009-02-17 02:25:11 +0000 (Tue, 17 Feb 2009) Log Message: ----------- Added the new length dialog box and removed the old version. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/Makefile.am trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/src/Dialogs.cpp 2009-02-17 02:25:11 UTC (rev 714) @@ -331,67 +331,6 @@ //***************************************************************************** -// Length -//***************************************************************************** - -int tLengthDlg::FromValue = 30; -int tLengthDlg::ToValue = 0; - -JEValueAlterationMode tLengthDlg::Mode; - -tLengthDlg::tLengthDlg(JZEventWindow* w, JZFilter *f) -: tPropertyListDlg("Length") -{ - Filter = f; - Song = f->GetSong(); -} - - -bool tLengthDlg::OnClose() -{ - tCmdLength cmd(Filter, FromValue, ToValue, Mode); - cmd.Execute(); - - JZProjectManager::Instance()->UpdateAllViews(); - - //tPropertyListDlg::OnClose(); - return false; -} - -void tLengthDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Length"); -} - - -void tLengthDlg::AddProperties() -{ - sheet->AddProperty(new wxProperty( - "Ticks/Quarter", - wxPropertyValue((long)Song->GetTicksPerQuarter()), - "integer", - new wxIntegerListValidator(-16, 16))); //r/o - - sheet->AddProperty(new wxProperty( - "Start", - wxPropertyValue(&FromValue), - "integer", - new wxIntegerListValidator(0, Song->GetTicksPerQuarter() * 4))); - sheet->AddProperty(new wxProperty( - "Stop", - wxPropertyValue(&ToValue), - "integer", - new wxIntegerListValidator(0, Song->GetTicksPerQuarter() * 4))); -// sheet->AddProperty(new wxProperty( -// "Mode", -// tNamedValueListValue(&Mode, gModes), -// "props", -// new tNamedValueListValidator(gModes))); -} - - - -//***************************************************************************** // seqLength //***************************************************************************** Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/src/Dialogs.h 2009-02-17 02:25:11 UTC (rev 714) @@ -120,24 +120,6 @@ void OnHelp(); }; -// Length -class tLengthDlg : public tPropertyListDlg -{ - public: - - static int FromValue, ToValue; - static JEValueAlterationMode Mode; - static char *mode_str; - - JZFilter *Filter; - JZSong *Song; - - tLengthDlg(JZEventWindow* win, JZFilter *f); - void AddProperties(); - bool OnClose(); - void OnHelp(); -}; - // seqLength class tSeqLengthDlg : public tPropertyListDlg { Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/src/EventWindow.cpp 2009-02-17 02:25:11 UTC (rev 714) @@ -24,6 +24,7 @@ #include "Command.h" #include "Dialogs/DeleteDialog.h" +#include "Dialogs/LengthDialog.h" #include "Dialogs/ShiftDialog.h" #include "Dialogs/VelocityDialog.h" #include "Dialogs.h" @@ -222,8 +223,23 @@ //----------------------------------------------------------------------------- void JZEventWindow::Length() { - tLengthDlg * dlg = new tLengthDlg(this, mpFilter); - dlg->Create(); + int FromValue = 30; + int ToValue = 0; + JEValueAlterationMode Mode = eSetValues; + + JZLengthDialog LengthDialog( + this, + mpFilter->GetSong()->GetTicksPerQuarter(), + FromValue, + ToValue, + Mode); + if (LengthDialog.ShowModal() == wxID_OK) + { + tCmdLength LengthCommand(mpFilter, FromValue, ToValue, Mode); + LengthCommand.Execute(); + + JZProjectManager::Instance()->UpdateAllViews(); + } } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/src/Makefile.am 2009-02-17 02:25:11 UTC (rev 714) @@ -25,6 +25,7 @@ Dialogs/DeleteDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ +Dialogs/LengthDialog.cpp \ Dialogs/KeyOnDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/ShiftDialog.cpp \ @@ -103,13 +104,16 @@ DeprecatedWx/prop.cpp \ DeprecatedWx/propform.cpp \ DeprecatedWx/proplist.cpp \ +Dialogs/DeleteDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ +Dialogs/LengthDialog.cpp \ Dialogs/KeyOnDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/ShiftDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ +Dialogs/VelocityDialog.cpp \ Dialogs.cpp \ DynamicArray.cpp \ ErrorMessage.cpp \ @@ -187,13 +191,16 @@ DeprecatedWx/propform.h \ DeprecatedWx/proplist.h \ DeprecatedStringUtils.h \ +Dialogs/DeleteDialog.h \ Dialogs/FilterDialog.h \ Dialogs/IntegerEdit.h \ +Dialogs/LengthDialog.h \ Dialogs/KeyOnDialog.h \ Dialogs/MetronomeSettingsDialog.h \ Dialogs/ShiftDialog.h \ Dialogs/SynthesizerSettingsDialog.h \ Dialogs/TrackDialog.h \ +Dialogs/VelocityDialog.h \ Dialogs.h \ DynamicArray.h \ ErrorMessage.h \ Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 02:25:11 UTC (rev 714) @@ -859,6 +859,14 @@ > </File> <File + RelativePath="..\src\Dialogs\LengthDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\LengthDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\MetronomeSettingsDialog.cpp" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 02:08:49 UTC (rev 713) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 02:25:11 UTC (rev 714) @@ -877,6 +877,14 @@ > </File> <File + RelativePath="..\src\Dialogs\LengthDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\LengthDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\MetronomeSettingsDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-17 14:45:59
|
Revision: 715 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=715&view=rev Author: pstieber Date: 2009-02-17 14:45:54 +0000 (Tue, 17 Feb 2009) Log Message: ----------- 1. Replaced the old MIDI channel and quantization dialogs with new versions. 2. Replaced the global quantization steps vector with a map. This really shouldn't be global. 3. Updated the interface to the quantization command. Modified Paths: -------------- trunk/jazz/src/Command.cpp trunk/jazz/src/Command.h trunk/jazz/src/Dialogs/LengthDialog.cpp trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/Globals.cpp trunk/jazz/src/Globals.h trunk/jazz/src/Makefile.am trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/Project.cpp trunk/jazz/src/Resources.h trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/MidiChannelDialog.cpp trunk/jazz/src/Dialogs/MidiChannelDialog.h trunk/jazz/src/Dialogs/QuantizeDialog.cpp trunk/jazz/src/Dialogs/QuantizeDialog.h Modified: trunk/jazz/src/Command.cpp =================================================================== --- trunk/jazz/src/Command.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Command.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -359,25 +359,33 @@ // tCmdQuantize // ************************************************************************ -tCmdQuantize::tCmdQuantize(JZFilter* pFilter, long clks, int grov, int dly) - : tCommand(pFilter) +tCmdQuantize::tCmdQuantize( + JZFilter* pFilter, + int QntClocks, + bool NoteStart, + bool NoteLength, + int Groove, + int Delay) + : tCommand(pFilter), + mQntClocks(QntClocks), + mNoteStart(NoteStart), + mNoteLength(NoteLength), + mGroove(Groove), + mDelay(Delay) { - QntClocks = clks; - Groove = grov; - Delay = dly; - NoteStart = 1; - NoteLength = 0; } -long tCmdQuantize::Quantize(long Clock, int islen) +long tCmdQuantize::Quantize(int Clock, int islen) { - Clock += QntClocks / 2; - Clock -= Clock % QntClocks; - if (!islen && (Clock % (2 * QntClocks) != 0)) - Clock += Groove; - Clock += Delay; - long minclk = islen ? 2 : 0; - return Clock > minclk ? Clock : minclk; + Clock += mQntClocks / 2; + Clock -= Clock % mQntClocks; + if (!islen && (Clock % (2 * mQntClocks) != 0)) + { + Clock += mGroove; + } + Clock += mDelay; + int MinClock = islen ? 2 : 0; + return Clock > MinClock ? Clock : MinClock; } void tCmdQuantize::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) @@ -386,11 +394,11 @@ if ((pKeyOn = pEvent->IsKeyOn()) != 0) { pKeyOn = (tKeyOn *)pEvent->Copy(); - if (NoteStart) + if (mNoteStart) { pKeyOn->SetClock(Quantize(pKeyOn->GetClock(), 0)); } - if (NoteLength) + if (mNoteLength) { pKeyOn->SetLength(Quantize(pKeyOn->GetEventLength(), 2)); } @@ -452,22 +460,22 @@ // tCmdSetChannel // ************************************************************************ -tCmdSetChannel::tCmdSetChannel(JZFilter* pFilter, int chan) - : tCommand(pFilter) +tCmdSetChannel::tCmdSetChannel(JZFilter* pFilter, int NewChannel) + : tCommand(pFilter), + mNewChannel(NewChannel) { - NewChannel = chan; } void tCmdSetChannel::ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent) { - tChannelEvent* c; + tChannelEvent* pChannelEvent; - if ((c = pEvent->IsChannelEvent()) != 0) + if ((pChannelEvent = pEvent->IsChannelEvent()) != 0) { - c = (tChannelEvent *)pEvent->Copy(); - c->SetChannel(NewChannel); + pChannelEvent = (tChannelEvent *)pEvent->Copy(); + pChannelEvent->SetChannel(mNewChannel); pTrack->Kill(pEvent); - pTrack->Put(c); + pTrack->Put(pChannelEvent); } } Modified: trunk/jazz/src/Command.h =================================================================== --- trunk/jazz/src/Command.h 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Command.h 2009-02-17 14:45:54 UTC (rev 715) @@ -209,15 +209,29 @@ //***************************************************************************** class tCmdQuantize : public tCommand { - long Quantize(long Clock, int islen); public: - long QntClocks; - int NoteStart; // yes - int NoteLength; // no - int Delay; // zero - int Groove; // zero - tCmdQuantize(JZFilter* pFilter, long QntClocks, int groove, int delay); + + tCmdQuantize( + JZFilter* pFilter, + int QntClocks, + bool NoteStart, + bool NoteLength, + int Groove, + int Delay); + virtual void ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent); + + private: + + long Quantize(int Clock, int islen); + + private: + + int mQntClocks; + bool mNoteStart; + bool mNoteLength; + int mDelay; + int mGroove; }; //***************************************************************************** @@ -241,9 +255,14 @@ class tCmdSetChannel : public tCommand { public: - int NewChannel; // 0 + tCmdSetChannel(JZFilter* pFilter, int NewChannel); + virtual void ExecuteEvent(JZTrack* pTrack, JZEvent* pEvent); + + private: + + int mNewChannel; }; //***************************************************************************** Modified: trunk/jazz/src/Dialogs/LengthDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/LengthDialog.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Dialogs/LengthDialog.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -142,7 +142,7 @@ wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); pFlexGridSizer->Add(mpLengthStopKnob, 0, wxALIGN_CENTER_VERTICAL); - pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER); + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER | wxALL, 5); pTopSizer->Add( mpModeRadioBox, Added: trunk/jazz/src/Dialogs/MidiChannelDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/MidiChannelDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/MidiChannelDialog.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -0,0 +1,139 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "MidiChannelDialog.h" + +#include "../Globals.h" +#include "../Help.h" +#include "../Knob.h" +#include "../Resources.h" + +#include <wx/button.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +#include <sstream> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZMidiChannelDialog, wxDialog) + + EVT_KNOB_CHANGED( + IDC_KB_MIDI_CHANNEL, + JZMidiChannelDialog::OnMidiChannelChange) + + EVT_BUTTON(wxID_HELP, JZMidiChannelDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZMidiChannelDialog::JZMidiChannelDialog(int& MidiChannel, wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Set MIDI Channel")), + mMidiChannel(MidiChannel), + mpMidiChannelKnob(0), + mpMidiChannelValue(0) +{ + mpMidiChannelKnob = new JZKnob( + this, + IDC_KB_MIDI_CHANNEL, + 0, + 0, + 16); + mpMidiChannelValue = new wxStaticText(this, wxID_ANY, "00"); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + wxFlexGridSizer* pFlexGridSizer = new wxFlexGridSizer(1, 3, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "MIDI Channel:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpMidiChannelValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpMidiChannelKnob, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZMidiChannelDialog::TransferDataToWindow() +{ + ostringstream Oss; + + Oss << mMidiChannel; + mpMidiChannelValue->SetLabel(Oss.str().c_str()); + + mpMidiChannelKnob->SetValue(mMidiChannel); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZMidiChannelDialog::TransferDataFromWindow() +{ + mMidiChannel = mpMidiChannelKnob->GetValue(); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZMidiChannelDialog::OnMidiChannelChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpMidiChannelValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZMidiChannelDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Set MIDI Channel"); +} Property changes on: trunk/jazz/src/Dialogs/MidiChannelDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/MidiChannelDialog.h =================================================================== --- trunk/jazz/src/Dialogs/MidiChannelDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/MidiChannelDialog.h 2009-02-17 14:45:54 UTC (rev 715) @@ -0,0 +1,58 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_MIDICHANNELDIALOG_H +#define JZ_MIDICHANNELDIALOG_H + +#include <wx/dialog.h> + +class JZKnob; +class JZKnobEvent; +class wxStaticText; + +//***************************************************************************** +//***************************************************************************** +class JZMidiChannelDialog : public wxDialog +{ + public: + + JZMidiChannelDialog(int& MidiChannel, wxWindow* pParent); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnMidiChannelChange(JZKnobEvent& Event); + + void OnHelp(wxCommandEvent& Event); + + private: + + int& mMidiChannel; + + JZKnob* mpMidiChannelKnob; + wxStaticText* mpMidiChannelValue; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_MIDICHANNELDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/MidiChannelDialog.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/QuantizeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/QuantizeDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/QuantizeDialog.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -0,0 +1,236 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "QuantizeDialog.h" + +#include "../Globals.h" +#include "../Help.h" +#include "../Knob.h" +#include "../Resources.h" + +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/combobox.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +#include <sstream> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZQuantizeDialog, wxDialog) + + EVT_KNOB_CHANGED( + IDC_KB_GROOVE, + JZQuantizeDialog::OnGrooveChange) + + EVT_KNOB_CHANGED( + IDC_KB_DELAY, + JZQuantizeDialog::OnDelayChange) + + EVT_BUTTON(wxID_HELP, JZQuantizeDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZQuantizeDialog::JZQuantizeDialog( + int& QuantizationStep, + bool& NoteStart, + bool& NoteLength, + int& Groove, + int& Delay, + wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Length")), + mQuantizationStep(QuantizationStep), + mNoteStart(NoteStart), + mNoteLength(NoteLength), + mGroove(Groove), + mDelay(Delay), + mpStepSizeComboBox(0), + mpNoteStartCheckBox(0), + mpNoteLengthCheckBox(0), + mpGrooveKnob(0), + mpGrooveValue(0), + mpDelayKnob(0), + mpDelayValue(0) +{ + mpStepSizeComboBox = new wxComboBox(this, wxID_ANY); + + for ( + map<int, string>::const_iterator iPair = gQntSteps.begin(); + iPair != gQntSteps.end(); + ++iPair) + { + const string& String = iPair->second; + mpStepSizeComboBox->Append(String.c_str()); + } + + mpNoteStartCheckBox = new wxCheckBox(this, wxID_ANY, "Note Start"); + mpNoteLengthCheckBox = new wxCheckBox(this, wxID_ANY, "Note Length"); + mpGrooveKnob = new JZKnob(this, IDC_KB_GROOVE, 0, -100, 100); + mpGrooveValue = new wxStaticText(this, wxID_ANY, "-000"); + mpDelayKnob = new JZKnob(this, IDC_KB_DELAY, 0, -100, 100); + mpDelayValue = new wxStaticText(this, wxID_ANY, "-000"); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(mpStepSizeComboBox, 0, wxALIGN_CENTER | wxALL, 6); + + pTopSizer->Add(mpNoteStartCheckBox, 0, wxALIGN_CENTER | wxALL, 6); + + pTopSizer->Add(mpNoteLengthCheckBox, 0, wxALIGN_CENTER | wxALL, 6); + + wxFlexGridSizer* pFlexGridSizer = new wxFlexGridSizer(2, 3, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Groove:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpGrooveValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpGrooveKnob, 0, wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Delay:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpDelayValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpDelayKnob, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER | wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZQuantizeDialog::TransferDataToWindow() +{ + int Selection = 0; + for ( + map<int, string>::const_iterator iPair = gQntSteps.begin(); + iPair != gQntSteps.end(); + ++iPair) + { + const int& Value = iPair->first; + if (Value <= mQuantizationStep) + { + break; + } + ++Selection; + } + mpStepSizeComboBox->SetSelection(Selection); + + mpNoteStartCheckBox->SetValue(mNoteStart); + mpNoteLengthCheckBox->SetValue(mNoteLength); + + ostringstream Oss; + + Oss << mGroove; + mpGrooveValue->SetLabel(Oss.str().c_str()); + mpGrooveKnob->SetValue(mGroove); + + Oss.str(""); + Oss << mDelay; + mpDelayValue->SetLabel(Oss.str().c_str()); + mpDelayKnob->SetValue(mDelay); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZQuantizeDialog::TransferDataFromWindow() +{ + wxString SelectedValue = mpStepSizeComboBox->GetValue(); + string SelectedString = SelectedValue.c_str(); + for ( + map<int, string>::const_iterator iPair = gQntSteps.begin(); + iPair != gQntSteps.end(); + ++iPair) + { + const string& String = iPair->second; + if (SelectedString == String) + { + mQuantizationStep = iPair->first; + break; + } + } + + mNoteStart = mpNoteStartCheckBox->GetValue(); + mNoteLength = mpNoteLengthCheckBox->GetValue(); + mGroove = mpGrooveKnob->GetValue(); + mDelay = mpDelayKnob->GetValue(); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZQuantizeDialog::OnGrooveChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpGrooveValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZQuantizeDialog::OnDelayChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpDelayValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZQuantizeDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Quantize"); +} Property changes on: trunk/jazz/src/Dialogs/QuantizeDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/QuantizeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/QuantizeDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/QuantizeDialog.h 2009-02-17 14:45:54 UTC (rev 715) @@ -0,0 +1,77 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_QUANTIZEDIALOG_H +#define JZ_QUANTIZEDIALOG_H + +#include <wx/dialog.h> + +class JZKnob; +class JZKnobEvent; +class wxComboBox; +class wxCheckBox; +class wxStaticText; + +//***************************************************************************** +//***************************************************************************** +class JZQuantizeDialog : public wxDialog +{ + public: + + JZQuantizeDialog( + int& QuantizationStep, + bool& NoteStart, + bool& NoteLength, + int& Groove, + int& Delay, + wxWindow* pParent); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnGrooveChange(JZKnobEvent& Event); + + void OnDelayChange(JZKnobEvent& Event); + + void OnHelp(wxCommandEvent& Event); + + private: + + int& mQuantizationStep; + bool& mNoteStart; + bool& mNoteLength; + int& mGroove; + int& mDelay; + + wxComboBox* mpStepSizeComboBox; + wxCheckBox* mpNoteStartCheckBox; + wxCheckBox* mpNoteLengthCheckBox; + JZKnob* mpGrooveKnob; + wxStaticText* mpGrooveValue; + JZKnob* mpDelayKnob; + wxStaticText* mpDelayValue; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_QUANTIZEDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/QuantizeDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Dialogs.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -282,54 +282,12 @@ "bool")); } -//***************************************************************************** -// SetChannel -//***************************************************************************** -int tSetChannelDlg::NewChannel = 1; -tSetChannelDlg::tSetChannelDlg(JZFilter *f) -: tPropertyListDlg("Set MIDI Channel") -{ - Filter = f; - Song = f->GetSong(); -} -bool tSetChannelDlg::OnClose() -{ - if (NewChannel) - { - tCmdSetChannel exe(Filter, NewChannel - 1); - exe.Execute(); - } - //tPropertyListDlg::OnClose(); - return false; -} -void tSetChannelDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Set MIDI Channel"); -} - - -void tSetChannelDlg::AddProperties() -{ - // Add(wxMakeFormShort("new Channel", &NewChannel, wxFORM_DEFAULT, -// new wxList(wxMakeConstraintRange(1.0, 16.0), 0))); -// Add(wxMakeFormNewLine()); - // AssociatePanel(panel); - - sheet->AddProperty(new wxProperty( - "new Channel", - wxPropertyValue(&NewChannel), - "integer", - new wxIntegerListValidator(1, 16))); -} - - - //***************************************************************************** // seqLength //***************************************************************************** @@ -481,77 +439,7 @@ } -//***************************************************************************** -// Quantize -//***************************************************************************** -bool tQuantizeDlg::NoteStart = 1; -bool tQuantizeDlg::NoteLength = 0; -int tQuantizeDlg::QntStep = 16; -int tQuantizeDlg::Delay = 0; -int tQuantizeDlg::Groove = 0; - -//tQuantizeDlg::tQuantizeDlg(JZEventFrame *w, JZFilter *f) -tQuantizeDlg::tQuantizeDlg(JZEventWindow *w, JZFilter *f) - : tPropertyListDlg("Quantize" ) - //, Steps("steps", gQntSteps, &gQntStep) -{ - Filter = f; - Song = f->GetSong(); -} - - - -bool tQuantizeDlg::OnClose() -{ - //Steps.GetValue(); - int step = Song->GetTicksPerQuarter() * 4 / QntStep; - tCmdQuantize qnt(Filter, step, Groove * step / 100, Delay * step / 100); - qnt.NoteStart = NoteStart; - qnt.NoteLength = NoteLength; - qnt.Execute(); - - JZProjectManager::Instance()->UpdateAllViews(); - - //tPropertyListDlg::OnClose(); - return false; -} - -void tQuantizeDlg::OnHelp() -{ -// if (mpEventWindow->NextWin) -// { -// gpHelpInstance->ShowTopic("Quantize"); -// } -// else -// { -// gpHelpInstance->ShowTopic("Pianowin Quantize"); -// } -} - -void tQuantizeDlg::AddProperties() -{ - sheet->AddProperty(new wxProperty( - "Note start", - wxPropertyValue((bool*)&NoteStart), - "bool")); - sheet->AddProperty(new wxProperty( - "Note length", - wxPropertyValue((bool*)&NoteLength), - "bool")); - sheet->AddProperty(new wxProperty( - "Groove", - wxPropertyValue(&Groove), - "int", - new wxRealListValidator(-100, 100))); - sheet->AddProperty(new wxProperty( - "Delay", - wxPropertyValue(&Delay), - "int", - new wxRealListValidator(-100, 100))); -} - - //***************************************************************************** // Event-Dialogue //***************************************************************************** Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Dialogs.h 2009-02-17 14:45:54 UTC (rev 715) @@ -104,22 +104,6 @@ void OnHelp(); }; -// SetChannel -class tSetChannelDlg : public tPropertyListDlg -{ - public: - - static int NewChannel; // 0 - - JZFilter *Filter; - JZSong *Song; - - tSetChannelDlg(JZFilter *f); - void AddProperties(); - bool OnClose(); - void OnHelp(); -}; - // seqLength class tSeqLengthDlg : public tPropertyListDlg { @@ -176,28 +160,6 @@ int* ptr; }; -class tQuantizeDlg : public tPropertyListDlg -{ - public: - - static bool NoteStart; // 1 - static bool NoteLength; // 0 - static int QntStep; // 1/16 - static int Groove; // -x .. +x - static int Delay; // -x .. +x - - JZFilter *Filter; - JZSong *Song; - - long Quantize(long); - - tQuantizeDlg(JZEventWindow* w, JZFilter* pFilter); - void AddProperties(); - //tNamedChoice Steps; - bool OnClose(); - void OnHelp(); -}; - void EventDialog( JZEvent*, JZPianoWindow*, Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/EventWindow.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -25,6 +25,8 @@ #include "Command.h" #include "Dialogs/DeleteDialog.h" #include "Dialogs/LengthDialog.h" +#include "Dialogs/MidiChannelDialog.h" +#include "Dialogs/QuantizeDialog.h" #include "Dialogs/ShiftDialog.h" #include "Dialogs/VelocityDialog.h" #include "Dialogs.h" @@ -161,13 +163,37 @@ { if (AreEventsSelected()) { -// wxDialogBox *panel = new wxDialogBox(this, "Quantize", FALSE ); - tQuantizeDlg* pQuantizeDlg = new tQuantizeDlg(this, mpFilter); - pQuantizeDlg->Create(); + int QuantizationStep = 16; + bool NoteStart = true; + bool NoteLength = false; + int Delay = 0; + int Groove = 0; -// tCmdQuantize QuantizeCommand(mpFilter, SnapClocks(), 0, 0); -// QuantizeCommand.Execute(1); -// JZProjectManager::Instance()->UpdateAllViews(); + JZQuantizeDialog QuantizeDialog( + QuantizationStep, + NoteStart, + NoteLength, + Groove, + Delay, + this); + + if (QuantizeDialog.ShowModal() == wxID_OK) + { + int Step = mpSong->GetTicksPerQuarter() * 4 / QuantizationStep; + + tCmdQuantize QuantizeCommand( + mpFilter, + QuantizationStep, + NoteStart, + NoteLength, + Groove * Step / 100, + Delay * Step / 100); + + QuantizeCommand.Execute(); +// QuantizeCommand.Execute(1); + + JZProjectManager::Instance()->UpdateAllViews(); + } } } @@ -175,8 +201,15 @@ //----------------------------------------------------------------------------- void JZEventWindow::SetChannel() { - tSetChannelDlg * dlg = new tSetChannelDlg(mpFilter); - dlg->Create(); + int NewChannel = 1; + + JZMidiChannelDialog MidiChannelDialog(NewChannel, this); + if (MidiChannelDialog.ShowModal() == wxID_OK) + { + tCmdSetChannel SetMidiChannelCommand(mpFilter, NewChannel - 1); + SetMidiChannelCommand.Execute(); + JZProjectManager::Instance()->UpdateAllViews(); + } } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Globals.cpp =================================================================== --- trunk/jazz/src/Globals.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Globals.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -51,7 +51,7 @@ vector<pair<string, int> > gScaleNames; -vector<pair<string, int> > gQntSteps; +map<int, string> gQntSteps; vector<pair<string, int> > gSynthesizerTypes; Modified: trunk/jazz/src/Globals.h =================================================================== --- trunk/jazz/src/Globals.h 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Globals.h 2009-02-17 14:45:54 UTC (rev 715) @@ -23,6 +23,7 @@ #ifndef JZ_GLOBALS_H #define JZ_GLOBALS_H +#include <map> #include <vector> #include <string> @@ -55,7 +56,7 @@ extern const int gScaleChromatic; extern const int gScaleSelected; extern std::vector<std::pair<std::string, int> > gScaleNames; -extern std::vector<std::pair<std::string, int> > gQntSteps; +extern std::map<int, std::string> gQntSteps; extern std::vector<std::pair<std::string, int> > gSynthesizerTypes; extern std::vector<std::pair<std::string, int> > gSynthesierTypeFiles; extern JZProject* gpProject; Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Makefile.am 2009-02-17 14:45:54 UTC (rev 715) @@ -28,6 +28,8 @@ Dialogs/LengthDialog.cpp \ Dialogs/KeyOnDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ +Dialogs/MidiChannelDialog.cpp \ +Dialogs/QuantizeDialog.cpp \ Dialogs/ShiftDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ @@ -110,6 +112,8 @@ Dialogs/LengthDialog.cpp \ Dialogs/KeyOnDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ +Dialogs/MidiChannelDialog.cpp \ +Dialogs/QuantizeDialog.cpp \ Dialogs/ShiftDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ @@ -197,6 +201,8 @@ Dialogs/LengthDialog.h \ Dialogs/KeyOnDialog.h \ Dialogs/MetronomeSettingsDialog.h \ +Dialogs/MidiChannelDialog.h \ +Dialogs/QuantizeDialog.h \ Dialogs/ShiftDialog.h \ Dialogs/SynthesizerSettingsDialog.h \ Dialogs/TrackDialog.h \ Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -2762,8 +2762,8 @@ { if (EventsSelected()) { - tCmdQuantize cmd(mpFilter, SnapClocks(), 0, 0); - cmd.Execute(1); + tCmdQuantize QuantizeCommand(mpFilter, SnapClocks(), true, false, 0, 0); + QuantizeCommand.Execute(1); Refresh(); } } Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Project.cpp 2009-02-17 14:45:54 UTC (rev 715) @@ -115,13 +115,13 @@ if (gQntSteps.empty()) { - gQntSteps.push_back(make_pair("1/8", 8)); - gQntSteps.push_back(make_pair("1/12", 12)); - gQntSteps.push_back(make_pair("1/16", 16)); - gQntSteps.push_back(make_pair("1/24", 24)); - gQntSteps.push_back(make_pair("1/32", 32)); - gQntSteps.push_back(make_pair("1/48", 48)); - gQntSteps.push_back(make_pair("1/96", 96)); + gQntSteps.insert(make_pair(8, "1/8")); + gQntSteps.insert(make_pair(12, "1/12")); + gQntSteps.insert(make_pair(16, "1/16")); + gQntSteps.insert(make_pair(24, "1/24")); + gQntSteps.insert(make_pair(32, "1/32")); + gQntSteps.insert(make_pair(48, "1/48")); + gQntSteps.insert(make_pair(96, "1/96")); } if (gSynthesizerTypes.empty()) Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/src/Resources.h 2009-02-17 14:45:54 UTC (rev 715) @@ -91,11 +91,18 @@ #define IDC_KB_CHANNEL wxID_HIGHEST + 1102 // JZVelocityDialog resource IDs. -#define IDC_KB_VELOCITY_START wxID_HIGHEST + 1201 -#define IDC_KB_VELOCITY_STOP wxID_HIGHEST + 1202 +#define IDC_KB_VELOCITY_START wxID_HIGHEST + 1200 +#define IDC_KB_VELOCITY_STOP wxID_HIGHEST + 1201 // JZLengthDialog resource IDs. -#define IDC_KB_LENGTH_START wxID_HIGHEST + 1301 -#define IDC_KB_LENGTH_STOP wxID_HIGHEST + 1302 +#define IDC_KB_LENGTH_START wxID_HIGHEST + 1210 +#define IDC_KB_LENGTH_STOP wxID_HIGHEST + 1211 +// JZMidiChannelDialog resource IDs. +#define IDC_KB_MIDI_CHANNEL wxID_HIGHEST + 1220 + +// JZQuantizeDialog resource IDs. +#define IDC_KB_GROOVE wxID_HIGHEST + 1230 +#define IDC_KB_DELAY wxID_HIGHEST + 1231 + #endif // !defined(JZ_RESOURCES_H) Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 14:45:54 UTC (rev 715) @@ -875,6 +875,22 @@ > </File> <File + RelativePath="..\src\Dialogs\MidiChannelDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\MidiChannelDialog.h" + > + </File> + <File + RelativePath="..\src\Dialogs\QuantizeDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\QuantizeDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\ShiftDialog.cpp" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 02:25:11 UTC (rev 714) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 14:45:54 UTC (rev 715) @@ -893,6 +893,22 @@ > </File> <File + RelativePath="..\src\Dialogs\MidiChannelDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\MidiChannelDialog.h" + > + </File> + <File + RelativePath="..\src\Dialogs\QuantizeDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\QuantizeDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\ShiftDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-02-19 15:06:51
|
Revision: 717 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=717&view=rev Author: pstieber Date: 2009-02-19 15:06:48 +0000 (Thu, 19 Feb 2009) Log Message: ----------- 1. Replaced the old piano window snap dialog with a new version. 2. Replaced the global limit steps vector with a map and updated the tNamedValueChoice class. The global limit steps map really shouldn't be global and the tNamedValueChoice class may eventually be removed. 3. Updated the interface to the piano window snap command. 4. Changed gQntSteps to gQuantizationSteps. 5. Changed a loop in the quantization dialog. Modified Paths: -------------- trunk/jazz/src/Dialogs/QuantizeDialog.cpp trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/Globals.cpp trunk/jazz/src/Globals.h trunk/jazz/src/Makefile.am trunk/jazz/src/NamedValueChoice.cpp trunk/jazz/src/NamedValueChoice.h trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/Project.cpp trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/SnapDialog.cpp trunk/jazz/src/Dialogs/SnapDialog.h Modified: trunk/jazz/src/Dialogs/QuantizeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/QuantizeDialog.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Dialogs/QuantizeDialog.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -79,8 +79,8 @@ mpStepSizeComboBox = new wxComboBox(this, wxID_ANY); for ( - map<int, string>::const_iterator iPair = gQntSteps.begin(); - iPair != gQntSteps.end(); + map<int, string>::const_iterator iPair = gQuantizationSteps.begin(); + iPair != gQuantizationSteps.end(); ++iPair) { const string& String = iPair->second; @@ -151,16 +151,15 @@ { int Selection = 0; for ( - map<int, string>::const_iterator iPair = gQntSteps.begin(); - iPair != gQntSteps.end(); - ++iPair) + map<int, string>::const_iterator iPair = gQuantizationSteps.begin(); + iPair != gQuantizationSteps.end(); + ++iPair, ++Selection) { const int& Value = iPair->first; if (Value <= mQuantizationStep) { break; } - ++Selection; } mpStepSizeComboBox->SetSelection(Selection); @@ -188,8 +187,8 @@ wxString SelectedValue = mpStepSizeComboBox->GetValue(); string SelectedString = SelectedValue.c_str(); for ( - map<int, string>::const_iterator iPair = gQntSteps.begin(); - iPair != gQntSteps.end(); + map<int, string>::const_iterator iPair = gQuantizationSteps.begin(); + iPair != gQuantizationSteps.end(); ++iPair) { const string& String = iPair->second; Added: trunk/jazz/src/Dialogs/SnapDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SnapDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/SnapDialog.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -0,0 +1,136 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "SnapDialog.h" + +#include "../Globals.h" +#include "../Help.h" + +#include <wx/choice.h> +#include <wx/button.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZSnapDialog, wxDialog) + + EVT_BUTTON(wxID_HELP, JZSnapDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZSnapDialog::JZSnapDialog(int& SnapDenominator, wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Snap")), + mSnapDenominator(SnapDenominator), + mpSnapValueChoice(0) +{ + mpSnapValueChoice = new wxChoice(this, wxID_ANY); + for ( + map<int, string>::const_iterator iLimitSteps = gLimitSteps.begin(); + iLimitSteps != gLimitSteps.end(); + ++iLimitSteps) + { + mpSnapValueChoice->Append(iLimitSteps->second); + } + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + pTopSizer->Add( + new wxStaticText(this, wxID_ANY, "Quantize Cut & Paste Events"), + 0, + wxALIGN_CENTER | wxALL, + 5); + + pTopSizer->Add(mpSnapValueChoice, 0, wxALIGN_CENTER | wxALL, 5); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSnapDialog::TransferDataToWindow() +{ + int Selection = 0; + for ( + map<int, string>::const_iterator iLimitSteps = gLimitSteps.begin(); + iLimitSteps != gLimitSteps.end(); + ++iLimitSteps, ++Selection) + { + const int& Value = iLimitSteps->first; + if (Value >= mSnapDenominator) + { + break; + } + } + mpSnapValueChoice->SetSelection(Selection); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSnapDialog::TransferDataFromWindow() +{ + wxString SelectedValue = mpSnapValueChoice->GetStringSelection(); + string SelectedString = SelectedValue.c_str(); + for ( + map<int, string>::const_iterator iLimitSteps = gLimitSteps.begin(); + iLimitSteps != gLimitSteps.end(); + ++iLimitSteps) + { + const string& String = iLimitSteps->second; + if (SelectedString == String) + { + mSnapDenominator = iLimitSteps->first; + break; + } + } + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSnapDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Snap"); +} Property changes on: trunk/jazz/src/Dialogs/SnapDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/SnapDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SnapDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/SnapDialog.h 2009-02-19 15:06:48 UTC (rev 717) @@ -0,0 +1,53 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_SNAPDIALOG_H +#define JZ_SNAPDIALOG_H + +#include <wx/dialog.h> + +class wxChoice; + +//***************************************************************************** +//***************************************************************************** +class JZSnapDialog : public wxDialog +{ + public: + + JZSnapDialog(int& SnapDenominator, wxWindow* pParent); + + private: + + bool TransferDataToWindow(); + + bool TransferDataFromWindow(); + + void OnHelp(wxCommandEvent& Event); + + private: + + int& mSnapDenominator; + + wxChoice* mpSnapValueChoice; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_SNAPDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/SnapDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Dialogs.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -163,17 +163,17 @@ // How it really ought to work (except the validator might ask the "value" // for the list of allowed values). // http://sourceforge.net/tracker/?group_id=9863&atid=109863 wx bugracker - tNamedValueListValue val1 = tNamedValueListValue( - &lowLimit, - gLimitSteps); +// tNamedValueListValue val1 = tNamedValueListValue( +// &lowLimit, +// gLimitSteps); - wxPropertyValue& val = val1; - cout << "little test:" << val.GetStringRepresentation() << endl; - sheet->AddProperty(new wxProperty( - "Delete shorther than", - (tNamedValueListValue&)val1, - "props", - new tNamedValueListValidator(gLimitSteps))); +// wxPropertyValue& val = val1; +// cout << "little test:" << val.GetStringRepresentation() << endl; +// sheet->AddProperty(new wxProperty( +// "Delete shorther than", +// (tNamedValueListValue&)val1, +// "props", +// new tNamedValueListValidator(gLimitSteps))); sheet->AddProperty(new wxProperty( "Shorten overlapping", @@ -394,53 +394,6 @@ //***************************************************************************** -// Snap -//***************************************************************************** - -tSnapDlg::tSnapDlg(JZPianoWindow* pPianoWindow, int* snapptr) - : tPropertyListDlg("Snap:quantize cut/paste events"), - mpPianoWindow(pPianoWindow) -{ -//, Steps("Snap value", limitSteps, snapptr) - //limitSteps lives in util.cpp - ptr = snapptr; -} - - - -bool tSnapDlg::OnClose() -{ - //Steps.GetValue(); - // toggle the tool buttons - mpPianoWindow->SetSnapDenom(*ptr); - //tPropertyListDlg::OnClose(); - return false; -} - -void tSnapDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Snap"); -} - -void tSnapDlg::AddProperties() -{ -// panel->SetLabelPosition(wxVERTICAL); -// Add(wxMakeFormMessage("quantize cut/paste events")); -// Add(wxMakeFormNewLine()); -// Add(Steps.mkFormItem(100)); -// Add(wxMakeFormNewLine()); -// AssociatePanel(panel); - - sheet->AddProperty(new wxProperty( - "Steps", - tNamedValueListValue(ptr, gLimitSteps), - "props", - new tNamedValueListValidator(gLimitSteps))); -} - - - -//***************************************************************************** // Event-Dialogue //***************************************************************************** Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Dialogs.h 2009-02-19 15:06:48 UTC (rev 717) @@ -139,27 +139,6 @@ void OnHelp(); }; -class tSnapDlg : public tPropertyListDlg -{ - public: - - tSnapDlg(JZPianoWindow* pPianoWindow, int* snapptr); - - void AddProperties(); - - //tNamedChoice Steps; - - bool OnClose(); - - void OnHelp(); - - private: - - JZPianoWindow* mpPianoWindow; - - int* ptr; -}; - void EventDialog( JZEvent*, JZPianoWindow*, Modified: trunk/jazz/src/Globals.cpp =================================================================== --- trunk/jazz/src/Globals.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Globals.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -41,7 +41,7 @@ JZHelp* gpHelpInstance = 0; -vector<pair<string, int> > gLimitSteps; +map<int, string> gLimitSteps; vector<pair<string, int> > gModes; @@ -51,7 +51,7 @@ vector<pair<string, int> > gScaleNames; -map<int, string> gQntSteps; +map<int, string> gQuantizationSteps; vector<pair<string, int> > gSynthesizerTypes; Modified: trunk/jazz/src/Globals.h =================================================================== --- trunk/jazz/src/Globals.h 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Globals.h 2009-02-19 15:06:48 UTC (rev 717) @@ -51,12 +51,12 @@ extern JZSynth* gpSynth; extern JZPlayer* gpMidiPlayer; extern JZHelp* gpHelpInstance; -extern std::vector<std::pair<std::string, int> > gLimitSteps; +extern std::map<int, std::string> gLimitSteps; extern std::vector<std::pair<std::string, int> > gModes; extern const int gScaleChromatic; extern const int gScaleSelected; extern std::vector<std::pair<std::string, int> > gScaleNames; -extern std::map<int, std::string> gQntSteps; +extern std::map<int, std::string> gQuantizationSteps; extern std::vector<std::pair<std::string, int> > gSynthesizerTypes; extern std::vector<std::pair<std::string, int> > gSynthesierTypeFiles; extern JZProject* gpProject; Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Makefile.am 2009-02-19 15:06:48 UTC (rev 717) @@ -31,6 +31,7 @@ Dialogs/MidiChannelDialog.cpp \ Dialogs/QuantizeDialog.cpp \ Dialogs/ShiftDialog.cpp \ +Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ Dialogs/VelocityDialog.cpp \ @@ -115,6 +116,7 @@ Dialogs/MidiChannelDialog.cpp \ Dialogs/QuantizeDialog.cpp \ Dialogs/ShiftDialog.cpp \ +Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ Dialogs/VelocityDialog.cpp \ @@ -204,6 +206,7 @@ Dialogs/MidiChannelDialog.h \ Dialogs/QuantizeDialog.h \ Dialogs/ShiftDialog.h \ +Dialogs/SnapDialog.h \ Dialogs/SynthesizerSettingsDialog.h \ Dialogs/TrackDialog.h \ Dialogs/VelocityDialog.h \ Modified: trunk/jazz/src/NamedValueChoice.cpp =================================================================== --- trunk/jazz/src/NamedValueChoice.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/NamedValueChoice.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -30,16 +30,16 @@ //----------------------------------------------------------------------------- tNamedValueChoice::tNamedValueChoice( wxWindow* pParent, - const vector<pair<string, int> >& Pairs) + const map<int, string>& Map) : wxChoice(pParent, wxID_ANY), - mPairs(Pairs) + mMap(Map) { for ( - vector<pair<string, int> >::const_iterator iPair = mPairs.begin(); - iPair != mPairs.end(); - ++iPair) + map<int, string>::const_iterator iMap = mMap.begin(); + iMap != mMap.end(); + ++iMap) { - Append(iPair->first); + Append(iMap->second); } } @@ -47,10 +47,20 @@ //----------------------------------------------------------------------------- int tNamedValueChoice::GetValue() { - int i = GetSelection(); - if (i >= 0) + int Selection = GetSelection(); + if (Selection >= 0) { - return mPairs[i].second; + int i = 0; + for ( + map<int, string>::const_iterator iMap = mMap.begin(); + iMap != mMap.end(); + ++iMap, ++i) + { + if (i == Selection) + { + return iMap->first; + } + } } return 16; } @@ -61,14 +71,14 @@ { int i = 0; for ( - vector<pair<string, int> >::const_iterator iPair = mPairs.begin(); - iPair != mPairs.end(); - ++iPair) + map<int, string>::const_iterator iMap = mMap.begin(); + iMap != mMap.end(); + ++iMap, ++i) { - if (iPair->second == Measure) + if (iMap->first == Measure) { SetSelection(i); + break; } - ++i; } } Modified: trunk/jazz/src/NamedValueChoice.h =================================================================== --- trunk/jazz/src/NamedValueChoice.h 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/NamedValueChoice.h 2009-02-19 15:06:48 UTC (rev 717) @@ -25,7 +25,7 @@ #include <wx/choice.h> -#include <vector> +#include <map> #include <string> //***************************************************************************** @@ -36,7 +36,7 @@ tNamedValueChoice( wxWindow* pParent, - const std::vector<std::pair<std::string, int> >& Pairs); + const std::map<int, std::string>& Map); int GetValue(); @@ -44,7 +44,7 @@ private: - const std::vector<std::pair<std::string, int> >& mPairs; + const std::map<int, std::string>& mMap; }; #endif // !defined(JZ_NAMEDVALUECHOICE_H) Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/PianoWindow.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -25,6 +25,7 @@ #include "Command.h" #include "ControlEdit.h" #include "Dialogs.h" +#include "Dialogs/SnapDialog.h" #include "Filter.h" #include "GuitarFrame.h" #include "Harmony.h" @@ -3114,8 +3115,8 @@ //----------------------------------------------------------------------------- void JZPianoWindow::SnapDialog() { - tSnapDlg* pSnapDialog = new tSnapDlg(this, &mSnapDenomiator); - pSnapDialog->Create(); + JZSnapDialog SnapDialog(mSnapDenomiator, this); + SnapDialog.ShowModal(); } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Project.cpp =================================================================== --- trunk/jazz/src/Project.cpp 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/src/Project.cpp 2009-02-19 15:06:48 UTC (rev 717) @@ -78,14 +78,14 @@ { if (gLimitSteps.empty()) { - gLimitSteps.push_back(make_pair( "1/8", 8)); - gLimitSteps.push_back(make_pair( "1/12", 12)); - gLimitSteps.push_back(make_pair( "1/16", 16)); - gLimitSteps.push_back(make_pair( "1/24", 24)); - gLimitSteps.push_back(make_pair( "1/32", 32)); - gLimitSteps.push_back(make_pair( "1/48", 48)); - gLimitSteps.push_back(make_pair( "1/96", 96)); - gLimitSteps.push_back(make_pair("1/192", 192)); + gLimitSteps.insert(make_pair( 8, "1/8")); + gLimitSteps.insert(make_pair( 12, "1/12")); + gLimitSteps.insert(make_pair( 16, "1/16")); + gLimitSteps.insert(make_pair( 24, "1/24")); + gLimitSteps.insert(make_pair( 32, "1/32")); + gLimitSteps.insert(make_pair( 48, "1/48")); + gLimitSteps.insert(make_pair( 96, "1/96")); + gLimitSteps.insert(make_pair(192, "1/192")); } if (gModes.empty()) @@ -113,15 +113,15 @@ gScaleNames.push_back(make_pair("Selected", gScaleSelected)); } - if (gQntSteps.empty()) + if (gQuantizationSteps.empty()) { - gQntSteps.insert(make_pair(8, "1/8")); - gQntSteps.insert(make_pair(12, "1/12")); - gQntSteps.insert(make_pair(16, "1/16")); - gQntSteps.insert(make_pair(24, "1/24")); - gQntSteps.insert(make_pair(32, "1/32")); - gQntSteps.insert(make_pair(48, "1/48")); - gQntSteps.insert(make_pair(96, "1/96")); + gQuantizationSteps.insert(make_pair(8, "1/8")); + gQuantizationSteps.insert(make_pair(12, "1/12")); + gQuantizationSteps.insert(make_pair(16, "1/16")); + gQuantizationSteps.insert(make_pair(24, "1/24")); + gQuantizationSteps.insert(make_pair(32, "1/32")); + gQuantizationSteps.insert(make_pair(48, "1/48")); + gQuantizationSteps.insert(make_pair(96, "1/96")); } if (gSynthesizerTypes.empty()) Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-02-19 15:06:48 UTC (rev 717) @@ -899,6 +899,14 @@ > </File> <File + RelativePath="..\src\Dialogs\SnapDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\SnapDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\SynthesizerSettingsDialog.cpp" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-17 17:36:54 UTC (rev 716) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-02-19 15:06:48 UTC (rev 717) @@ -917,6 +917,14 @@ > </File> <File + RelativePath="..\src\Dialogs\SnapDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\SnapDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\SynthesizerSettingsDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-05-16 15:06:04
|
Revision: 720 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=720&view=rev Author: pstieber Date: 2009-05-16 15:05:54 +0000 (Sat, 16 May 2009) Log Message: ----------- 1. Added an updated cleanup dialog. 2. Changed the JZPlayer rec_info data member to mpRecordingInfo. 3. Made some cosmetic indentation changes ti the delete dialog header. 4. Removed the use of & in a wxStaticText control in the snap dialog because it is translated into an underscore. 5. Reordered the includes in the snap dialog. 6. Made a cosmetic indentation change in the snap dialog. Modified Paths: -------------- trunk/jazz/src/Dialogs/DeleteDialog.h trunk/jazz/src/Dialogs/SnapDialog.cpp trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventWindow.cpp trunk/jazz/src/Makefile.am trunk/jazz/src/Player.cpp trunk/jazz/src/Player.h trunk/jazz/src/mswin/WindowsAudioInterface.cpp trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/CleanupDialog.cpp trunk/jazz/src/Dialogs/CleanupDialog.h Added: trunk/jazz/src/Dialogs/CleanupDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/CleanupDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/CleanupDialog.cpp 2009-05-16 15:05:54 UTC (rev 720) @@ -0,0 +1,157 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "CleanupDialog.h" + +#include "../Globals.h" +#include "../Help.h" + +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/choice.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZCleanupDialog, wxDialog) + + EVT_BUTTON(wxID_HELP, JZCleanupDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZCleanupDialog::JZCleanupDialog( + int& ShortestNote, + bool& ShortenOverlappingNotes, + wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Cleanup")), + mShortestNote(ShortestNote), + mShortenOverlappingNotes(ShortenOverlappingNotes), + mpShortestNoteChoice(0), + mpShortenOverlappingNotesCheckBox(0) +{ + mpShortestNoteChoice = new wxChoice(this, wxID_ANY); + for ( + map<int, string>::const_iterator iLimitSteps = gLimitSteps.begin(); + iLimitSteps != gLimitSteps.end(); + ++iLimitSteps) + { + mpShortestNoteChoice->Append(iLimitSteps->second); + } + + mpShortenOverlappingNotesCheckBox = new wxCheckBox( + this, + wxID_ANY, + "Shorten overlapping notes"); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + pTopSizer->Add( + new wxStaticText(this, wxID_ANY, "Delete notes shorter than:"), + 0, + wxALIGN_CENTER | wxALL, + 5); + + pTopSizer->Add(mpShortestNoteChoice, 0, wxALIGN_CENTER | wxALL, 5); + + pTopSizer->Add( + mpShortenOverlappingNotesCheckBox, + 0, + wxALIGN_CENTER | wxALL, + 10); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZCleanupDialog::TransferDataToWindow() +{ + int Selection = 0; + for ( + map<int, string>::const_iterator iLimitSteps = gLimitSteps.begin(); + iLimitSteps != gLimitSteps.end(); + ++iLimitSteps, ++Selection) + { + const int& Value = iLimitSteps->first; + if (Value >= mShortestNote) + { + break; + } + } + mpShortestNoteChoice->SetSelection(Selection); + + mpShortenOverlappingNotesCheckBox->SetValue(mShortenOverlappingNotes); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZCleanupDialog::TransferDataFromWindow() +{ + wxString SelectedValue = mpShortestNoteChoice->GetStringSelection(); + string SelectedString = SelectedValue.c_str(); + for ( + map<int, string>::const_iterator iLimitSteps = gLimitSteps.begin(); + iLimitSteps != gLimitSteps.end(); + ++iLimitSteps) + { + const string& String = iLimitSteps->second; + if (SelectedString == String) + { + mShortestNote = iLimitSteps->first; + break; + } + } + + mShortenOverlappingNotes = mpShortenOverlappingNotesCheckBox->GetValue(); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZCleanupDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Cleanup"); +} Property changes on: trunk/jazz/src/Dialogs/CleanupDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/CleanupDialog.h =================================================================== --- trunk/jazz/src/Dialogs/CleanupDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/CleanupDialog.h 2009-05-16 15:05:54 UTC (rev 720) @@ -0,0 +1,61 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_CLEANUPDIALOG_H +#define JZ_CLEANUPDIALOG_H + +#include <wx/dialog.h> + +class wxChoice; +class wxCheckBox; + +//***************************************************************************** +//***************************************************************************** +class JZCleanupDialog : public wxDialog +{ + public: + + JZCleanupDialog( + int& ShortestNote, + bool& ShortenOverlappingNotes, + wxWindow* pParent); + + private: + + bool TransferDataToWindow(); + + bool TransferDataFromWindow(); + + void OnHelp(wxCommandEvent& Event); + + private: + + int& mShortestNote; + + bool& mShortenOverlappingNotes; + + wxChoice* mpShortestNoteChoice; + + wxCheckBox* mpShortenOverlappingNotesCheckBox; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_CLEANUPDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/CleanupDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs/DeleteDialog.h =================================================================== --- trunk/jazz/src/Dialogs/DeleteDialog.h 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/src/Dialogs/DeleteDialog.h 2009-05-16 15:05:54 UTC (rev 720) @@ -43,9 +43,9 @@ private: - bool& mLeaveSpace; + bool& mLeaveSpace; - wxCheckBox* mpLeaveSpaceCheckBox; + wxCheckBox* mpLeaveSpaceCheckBox; DECLARE_EVENT_TABLE(); }; Modified: trunk/jazz/src/Dialogs/SnapDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SnapDialog.cpp 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/src/Dialogs/SnapDialog.cpp 2009-05-16 15:05:54 UTC (rev 720) @@ -23,8 +23,8 @@ #include "../Globals.h" #include "../Help.h" +#include <wx/button.h> #include <wx/choice.h> -#include <wx/button.h> #include <wx/sizer.h> #include <wx/stattext.h> @@ -64,7 +64,7 @@ wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); pTopSizer->Add( - new wxStaticText(this, wxID_ANY, "Quantize Cut & Paste Events"), + new wxStaticText(this, wxID_ANY, "Quantize Cut and Paste Events"), 0, wxALIGN_CENTER | wxALL, 5); @@ -125,7 +125,7 @@ } } - return true; + return true; } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/src/Dialogs.cpp 2009-05-16 15:05:54 UTC (rev 720) @@ -102,88 +102,7 @@ //} -//***************************************************************************** -// Cleanup -//***************************************************************************** -int tCleanupDlg::lowLimit = 48; -bool tCleanupDlg::shortenOverlaps = 1; - - - -tCleanupDlg::tCleanupDlg(JZEventWindow* w, JZFilter *f) - : tPropertyListDlg( "Clean up events" ) -{ - Filter = f; - Song = f->GetSong(); -} - - - -bool tCleanupDlg::OnClose() -{ - int limit = Song->GetTicksPerQuarter() * 4 / lowLimit; - cout - << "tCleanupDlg::OnClose " << lowLimit << ' ' << shortenOverlaps - << endl; - tCmdCleanup cln(Filter, limit, shortenOverlaps); - cln.Execute(); - - JZProjectManager::Instance()->UpdateAllViews(); - - //wxForm::OnOk(); - return false; -} - -void tCleanupDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Cleanup"); -} - - -//IMPLEMENT_DYNAMIC_CLASS(tNamedValueListValue, wxPropertyValue) - -void tCleanupDlg::AddProperties() -{ - // JAVE this doesnt work -// sheet->AddProperty(new wxProperty( -// "Delete notes shorther than", -// wxPropertyValue("1/8"), -// "props", -// Steps.GetStringListValidator())); - - // how it ought to work - // gLimitSteps is a name/value pair vector -// sheet->AddProperty(new wxProperty( -// "Delete notes shorther than", -// wxPropertyValue(&lowLimit), -// "props", -// new tNamedValueListValidator(gLimitSteps))); - - // How it really ought to work (except the validator might ask the "value" - // for the list of allowed values). - // http://sourceforge.net/tracker/?group_id=9863&atid=109863 wx bugracker -// tNamedValueListValue val1 = tNamedValueListValue( -// &lowLimit, -// gLimitSteps); - -// wxPropertyValue& val = val1; -// cout << "little test:" << val.GetStringRepresentation() << endl; -// sheet->AddProperty(new wxProperty( -// "Delete shorther than", -// (tNamedValueListValue&)val1, -// "props", -// new tNamedValueListValidator(gLimitSteps))); - - sheet->AddProperty(new wxProperty( - "Shorten overlapping", - wxPropertyValue((bool*)&shortenOverlaps), "bool")); - - // There seems to be a padding limit in - // wxPropertyListView::MakeNameValueString set to 25. -} - - //***************************************************************************** // SearchReplace //***************************************************************************** Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/src/Dialogs.h 2009-05-16 15:05:54 UTC (rev 720) @@ -50,23 +50,6 @@ // void OnHelp(); //}; -class tCleanupDlg : public tPropertyListDlg -{ - public: - - static int lowLimit; // 1/32 - static bool shortenOverlaps; - - JZFilter *Filter; - JZSong *Song; - - tCleanupDlg(JZEventWindow* w, JZFilter *f); - void AddProperties(); - //tNamedChoice Steps; - bool OnClose(); - void OnHelp(); -}; - class tSearchReplaceDlg : public tPropertyListDlg { public: Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/src/EventFrame.cpp 2009-05-16 15:05:54 UTC (rev 720) @@ -39,6 +39,9 @@ EVT_UPDATE_UI(ID_SHIFT, JZEventFrame::OnUpdateEventsSelected) EVT_MENU(ID_SHIFT, JZEventFrame::OnShift) + EVT_UPDATE_UI(ID_CLEANUP, JZEventFrame::OnUpdateEventsSelected) + EVT_MENU(ID_CLEANUP, JZEventFrame::OnCleanup) + EVT_UPDATE_UI(ID_QUANTIZE, JZEventFrame::OnUpdateEventsSelected) EVT_MENU(ID_QUANTIZE, JZEventFrame::OnQuantize) Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/src/EventWindow.cpp 2009-05-16 15:05:54 UTC (rev 720) @@ -23,6 +23,7 @@ #include "EventWindow.h" #include "Command.h" +#include "Dialogs/CleanupDialog.h" #include "Dialogs/DeleteDialog.h" #include "Dialogs/LengthDialog.h" #include "Dialogs/MidiChannelDialog.h" @@ -288,8 +289,24 @@ //----------------------------------------------------------------------------- void JZEventWindow::Cleanup() { - tCleanupDlg * dlg = new tCleanupDlg(this, mpFilter); - dlg->Create(); + int ShortestNote = 48; + bool ShortenOverlappingNotes = false; + + JZCleanupDialog CleanupDialog(ShortestNote, ShortenOverlappingNotes, this); + if (CleanupDialog.ShowModal() == wxID_OK) + { + int LengthLimit = + mpFilter->GetSong()->GetTicksPerQuarter() * 4 / ShortestNote; + + tCmdCleanup CleanupCommand( + mpFilter, + LengthLimit, + ShortenOverlappingNotes); + + CleanupCommand.Execute(); + + JZProjectManager::Instance()->UpdateAllViews(); + } } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/src/Makefile.am 2009-05-16 15:05:54 UTC (rev 720) @@ -22,6 +22,7 @@ DeprecatedWx/prop.cpp \ DeprecatedWx/propform.cpp \ DeprecatedWx/proplist.cpp \ +Dialogs/CleanupDialog.cpp \ Dialogs/DeleteDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ @@ -107,6 +108,7 @@ DeprecatedWx/prop.cpp \ DeprecatedWx/propform.cpp \ DeprecatedWx/proplist.cpp \ +Dialogs/CleanupDialog.cpp \ Dialogs/DeleteDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ @@ -197,6 +199,7 @@ DeprecatedWx/propform.h \ DeprecatedWx/proplist.h \ DeprecatedStringUtils.h \ +Dialogs/CleanupDialog.h \ Dialogs/DeleteDialog.h \ Dialogs/FilterDialog.h \ Dialogs/IntegerEdit.h \ Modified: trunk/jazz/src/Player.cpp =================================================================== --- trunk/jazz/src/Player.cpp 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/src/Player.cpp 2009-05-16 15:05:54 UTC (rev 720) @@ -191,7 +191,7 @@ Playing = false; PlayLoop = new tPlayLoop(); AudioBuffer = 0; - rec_info = 0; + mpRecordingInfo = 0; } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/src/Player.h 2009-05-16 15:05:54 UTC (rev 720) @@ -139,7 +139,7 @@ tPlayLoop* PlayLoop; // timer value for polling the record queue int poll_millisec; - JZRecordingInfo* rec_info; // 0 == not recording + JZRecordingInfo* mpRecordingInfo; // 0 == not recording public: @@ -157,7 +157,7 @@ tEventArray mRecdBuffer; void SetRecordInfo(JZRecordingInfo* inf) { - rec_info = inf; + mpRecordingInfo = inf; } bool IsPlaying() const Modified: trunk/jazz/src/mswin/WindowsAudioInterface.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsAudioInterface.cpp 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/src/mswin/WindowsAudioInterface.cpp 2009-05-16 15:05:54 UTC (rev 720) @@ -61,7 +61,7 @@ mpPlayer->mpListener = this; // Indicate that we are not recording! - mpPlayer->rec_info = 0; + mpPlayer->mpRecordingInfo = 0; mChannels = mpPlayer->mSamples.GetChannels(); @@ -88,7 +88,7 @@ mpPlayer->mpListener = this; // Indicate that we are not recording! - mpPlayer->rec_info = 0; + mpPlayer->mpRecordingInfo = 0; mChannels = mpPlayer->mSamples.GetChannels(); @@ -633,10 +633,10 @@ mSamples.StopPlay(); if (RecordMode()) { - long frc = rec_info->mFromClock; + long frc = mpRecordingInfo->mFromClock; if (frc < start_clock) frc = start_clock; - long toc = rec_info->mToClock; + long toc = mpRecordingInfo->mToClock; long play_clock = Time2Clock(mpState->play_time); if (toc > play_clock) toc = play_clock; @@ -708,5 +708,5 @@ //----------------------------------------------------------------------------- int JZWindowsAudioPlayer::RecordMode() const { - return rec_info != 0 && rec_info->mpTrack->GetAudioMode(); + return mpRecordingInfo != 0 && mpRecordingInfo->mpTrack->GetAudioMode(); } Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-05-16 15:05:54 UTC (rev 720) @@ -827,6 +827,14 @@ Name="Dialog Source Files" > <File + RelativePath="..\src\Dialogs\CleanupDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\CleanupDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\DeleteDialog.cpp" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-05-16 04:16:22 UTC (rev 719) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-05-16 15:05:54 UTC (rev 720) @@ -845,6 +845,14 @@ Name="Dialog Source Files" > <File + RelativePath="..\src\Dialogs\CleanupDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\CleanupDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\DeleteDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2009-06-21 20:55:01
|
Revision: 732 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=732&view=rev Author: pstieber Date: 2009-06-21 20:54:58 +0000 (Sun, 21 Jun 2009) Log Message: ----------- Added new versions of the search and replace and transpose dialogs. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventWindow.cpp trunk/jazz/src/Makefile.am trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h trunk/jazz/src/Dialogs/TransposeDialog.cpp trunk/jazz/src/Dialogs/TransposeDialog.h Added: trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp 2009-06-21 20:54:58 UTC (rev 732) @@ -0,0 +1,133 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "SearchAndReplaceDialog.h" + +#include "../Configuration.h" +#include "../Globals.h" +#include "../Help.h" + +#include <wx/button.h> +#include <wx/listbox.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZSearchAndReplaceDialog, wxDialog) + + EVT_BUTTON(wxID_HELP, JZSearchAndReplaceDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZSearchAndReplaceDialog::JZSearchAndReplaceDialog( + short From, + short To, + wxWindow* pParent) + : wxDialog( + pParent, + wxID_ANY, + wxString("Search and replace controller types")), + mFrom(From), + mTo(To), + mpFromListBox(0), + mpToListBox(0) + +{ + mpFromListBox = new wxListBox(this, wxID_ANY); + mpToListBox = new wxListBox(this, wxID_ANY); + + const vector<pair<string, int> >& ControlNames = + gpConfig->GetControlNames(); + for ( + vector<pair<string, int> >::const_iterator iControlName = + ControlNames.begin(); + iControlName != ControlNames.end(); + ++iControlName) + { + const string& ControlName = iControlName->first; + if (!ControlName.empty()) + { + mpFromListBox->Append(ControlName); + mpToListBox->Append(ControlName); + } + } + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + pTopSizer->Add( + new wxStaticText(this, wxID_ANY, "Search and replace controller types"), + 0, + wxALIGN_CENTER | wxALL, + 6); + + wxBoxSizer* pLeftSizer = new wxBoxSizer(wxVERTICAL); + pLeftSizer->Add( + new wxStaticText(this, wxID_ANY, "Search for"), + 0, + wxALL, + 3); + pLeftSizer->Add(mpFromListBox, 0, wxALIGN_CENTER | wxALL, 3); + + wxBoxSizer* pRightSizer = new wxBoxSizer(wxVERTICAL); + pRightSizer->Add( + new wxStaticText(this, wxID_ANY, "Replace with"), + 0, + wxALL, + 3); + pRightSizer->Add(mpToListBox, 0, wxALIGN_CENTER | wxALL, 3); + + wxBoxSizer* pListBoxSizer = new wxBoxSizer(wxHORIZONTAL); + pListBoxSizer->Add(pLeftSizer, 0, wxALL, 3); + pListBoxSizer->Add(pRightSizer, 0, wxALL, 3); + + pTopSizer->Add(pListBoxSizer, 0, wxALL, 3); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSearchAndReplaceDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Search Replace"); +} Property changes on: trunk/jazz/src/Dialogs/SearchAndReplaceDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h 2009-06-21 20:54:58 UTC (rev 732) @@ -0,0 +1,51 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_SEARCHANDREPLACEDIALOG_H +#define JZ_SEARCHANDREPLACEDIALOG_H + +#include <wx/dialog.h> + +class wxListBox; + +//***************************************************************************** +//***************************************************************************** +class JZSearchAndReplaceDialog : public wxDialog +{ + public: + + JZSearchAndReplaceDialog(short From, short To, wxWindow* pParent); + + private: + + void OnHelp(wxCommandEvent& Event); + + private: + + short mFrom; + short mTo; + + wxListBox* mpFromListBox; + wxListBox* mpToListBox; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_SEARCHANDREPLACEDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/SearchAndReplaceDialog.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/TransposeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/TransposeDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/TransposeDialog.cpp 2009-06-21 20:54:58 UTC (rev 732) @@ -0,0 +1,175 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "TransposeDialog.h" + +#include "../Globals.h" +#include "../Help.h" +#include "../Knob.h" +#include "../Resources.h" + +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/combobox.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +#include <sstream> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZTransposeDialog, wxDialog) + + EVT_KNOB_CHANGED( + IDC_KB_AMOUNT, + JZTransposeDialog::OnAmountChange) + + EVT_BUTTON(wxID_HELP, JZTransposeDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZTransposeDialog::JZTransposeDialog( + int CurrentScale, + int Notes, + int Scale, + bool FitIntoScale, + wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Transpose")), + mNotes(Notes), + mScale(Scale), + mFitIntoScale(FitIntoScale), + mpAmountKnob(0), + mpAmountValue(0), + mpFitIntoScaleCheckBox(0), + mpScaleNamesComboBox(0) +{ + wxString CurrentSelectionText; + CurrentSelectionText + << "Current selection looks like " << gScaleNames[CurrentScale + 2].first; + + mpAmountKnob = new JZKnob(this, IDC_KB_AMOUNT, 0, -12, 12); + mpAmountValue = new wxStaticText(this, wxID_ANY, "-00"); + + mpFitIntoScaleCheckBox = new wxCheckBox(this, wxID_ANY, "Fit into Scale"); + + mpScaleNamesComboBox = new wxComboBox(this, wxID_ANY); + + for ( + vector<pair<string, int> >::const_iterator iPair = gScaleNames.begin(); + iPair != gScaleNames.end(); + ++iPair) + { + const string& String = iPair->first; + mpScaleNamesComboBox->Append(String.c_str()); + } + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + pTopSizer->Add( + new wxStaticText(this, wxID_ANY, CurrentSelectionText), + 0, + wxALIGN_CENTER | wxALL, + 5); + + wxFlexGridSizer* pFlexGridSizer = new wxFlexGridSizer(1, 3, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Amount:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpAmountValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpAmountKnob, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER | wxALL, 5); + + pTopSizer->Add(mpFitIntoScaleCheckBox, 0, wxALIGN_CENTER | wxALL, 5); + + pTopSizer->Add(mpScaleNamesComboBox, 0, wxALIGN_CENTER | wxALL, 5); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZTransposeDialog::TransferDataToWindow() +{ + mpFitIntoScaleCheckBox->SetValue(mFitIntoScale); + + ostringstream Oss; + + Oss << mNotes; + mpAmountValue->SetLabel(Oss.str().c_str()); + mpAmountKnob->SetValue(mNotes); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZTransposeDialog::TransferDataFromWindow() +{ + mFitIntoScale = mpFitIntoScaleCheckBox->GetValue(); + + mNotes = mpAmountKnob->GetValue(); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTransposeDialog::OnAmountChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpAmountValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTransposeDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Transpose"); +} Property changes on: trunk/jazz/src/Dialogs/TransposeDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/TransposeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/TransposeDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/TransposeDialog.h 2009-06-21 20:54:58 UTC (rev 732) @@ -0,0 +1,69 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_TRANSPOSEDIALOG_H +#define JZ_TRANSPOSEDIALOG_H + +#include <wx/dialog.h> + +class JZKnob; +class JZKnobEvent; +class wxCheckBox; +class wxComboBox; +class wxStaticText; + +//***************************************************************************** +//***************************************************************************** +class JZTransposeDialog : public wxDialog +{ + public: + + JZTransposeDialog( + int CurrentScale, + int Notes, + int Scale, + bool FitIntoScale, + wxWindow* pParent); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnAmountChange(JZKnobEvent& Event); + + void OnHelp(wxCommandEvent& Event); + + private: + + int& mNotes; + int& mScale; + bool& mFitIntoScale; + + JZKnob* mpAmountKnob; + wxStaticText* mpAmountValue; + wxCheckBox* mpFitIntoScaleCheckBox; + wxComboBox* mpScaleNamesComboBox; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_TRANSPOSEDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/TransposeDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2009-06-21 20:46:58 UTC (rev 731) +++ trunk/jazz/src/Dialogs.cpp 2009-06-21 20:54:58 UTC (rev 732) @@ -127,11 +127,6 @@ return false; } -void tSearchReplaceDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Search Replace"); -} - void tSearchReplaceDlg::AddProperties() { sheet->AddProperty(new wxProperty( @@ -149,65 +144,7 @@ - //***************************************************************************** -// Transpose -//***************************************************************************** - -int tTransposeDlg::Notes = 0; -int tTransposeDlg::Scale = gScaleChromatic; -bool tTransposeDlg::FitIntoScale = 0; - -tTransposeDlg::tTransposeDlg(JZEventWindow* w, JZFilter *f) - : tPropertyListDlg("Transpose") -{ - Filter = f; - Song = f->GetSong(); -} - - -bool tTransposeDlg::OnClose() -{ - tCmdTranspose trn(Filter, Notes, Scale, FitIntoScale); - trn.Execute(); - - JZProjectManager::Instance()->UpdateAllViews(); - - return false; -} - -void tTransposeDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Transpose"); -} - - -void tTransposeDlg::AddProperties() -{ - int s = tScale::Analyze(Filter); - - sheet->AddProperty(new wxProperty( - "selection looks like", - wxPropertyValue(gScaleNames[s + 2].first), - "string")); - sheet->AddProperty(new wxProperty( - "Amount", - wxPropertyValue(&Notes), - "integer", - new wxIntegerListValidator(-12, 12))); - sheet->AddProperty(new wxProperty( - "Fit into Scale", - wxPropertyValue((bool*)&FitIntoScale), - "bool")); -} - - - - - - - -//***************************************************************************** // seqLength //***************************************************************************** Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2009-06-21 20:46:58 UTC (rev 731) +++ trunk/jazz/src/Dialogs.h 2009-06-21 20:54:58 UTC (rev 732) @@ -68,25 +68,6 @@ void OnHelp(); }; -// Transpose -class tTransposeDlg : public tPropertyListDlg -{ - public: - - static int Notes; // 0 - static bool FitIntoScale; - static int Scale; - - JZFilter *Filter; - JZSong *Song; - - //tNamedChoice ScaleDlg; - tTransposeDlg(JZEventWindow* w, JZFilter *f); - void AddProperties(); - bool OnClose(); - void OnHelp(); -}; - // seqLength class tSeqLengthDlg : public tPropertyListDlg { Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2009-06-21 20:46:58 UTC (rev 731) +++ trunk/jazz/src/EventWindow.cpp 2009-06-21 20:54:58 UTC (rev 732) @@ -28,7 +28,9 @@ #include "Dialogs/LengthDialog.h" #include "Dialogs/MidiChannelDialog.h" #include "Dialogs/QuantizeDialog.h" +#include "Dialogs/SearchAndReplaceDialog.h" #include "Dialogs/ShiftDialog.h" +#include "Dialogs/TransposeDialog.h" #include "Dialogs/VelocityDialog.h" #include "Dialogs.h" #include "EventFrame.h" @@ -217,8 +219,23 @@ //----------------------------------------------------------------------------- void JZEventWindow::Transpose() { - tTransposeDlg * dlg = new tTransposeDlg(this, mpFilter); - dlg->Create(); + int CurrentScale = tScale::Analyze(mpFilter); + int Notes = 0, Scale = gScaleChromatic; + bool FitIntoScale = false; + + JZTransposeDialog TransposeDialog( + CurrentScale, + Notes, + Scale, + FitIntoScale, + this); + if (TransposeDialog.ShowModal() == wxID_OK) + { + tCmdTranspose TransposeCommand(mpFilter, Notes, Scale, FitIntoScale); + TransposeCommand.Execute(); + + JZProjectManager::Instance()->UpdateAllViews(); + } } //----------------------------------------------------------------------------- @@ -313,8 +330,17 @@ //----------------------------------------------------------------------------- void JZEventWindow::SearchReplace() { - tSearchReplaceDlg * dlg = new tSearchReplaceDlg(this, mpFilter); - dlg->Create(); + short From = 1, To = 1; + + JZSearchAndReplaceDialog SearchAndReplaceDialog(From, To, this); + if (SearchAndReplaceDialog.ShowModal() == wxID_OK) + { + tCmdSearchReplace SearchAndReplaceCommand(mpFilter, From - 1, To - 1); + + SearchAndReplaceCommand.Execute(); + + JZProjectManager::Instance()->UpdateAllViews(); + } } //----------------------------------------------------------------------------- Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2009-06-21 20:46:58 UTC (rev 731) +++ trunk/jazz/src/Makefile.am 2009-06-21 20:54:58 UTC (rev 732) @@ -31,10 +31,12 @@ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/MidiChannelDialog.cpp \ Dialogs/QuantizeDialog.cpp \ +Dialogs/SearchAndReplaceDialog.cpp \ Dialogs/ShiftDialog.cpp \ Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ +Dialogs/TransposeDialog.cpp \ Dialogs/VelocityDialog.cpp \ Dialogs.cpp \ DynamicArray.cpp \ @@ -117,10 +119,12 @@ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/MidiChannelDialog.cpp \ Dialogs/QuantizeDialog.cpp \ +Dialogs/SearchAndReplaceDialog.cpp \ Dialogs/ShiftDialog.cpp \ Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/TrackDialog.cpp \ +Dialogs/TransposeDialog.cpp \ Dialogs/VelocityDialog.cpp \ Dialogs.cpp \ DynamicArray.cpp \ @@ -208,10 +212,12 @@ Dialogs/MetronomeSettingsDialog.h \ Dialogs/MidiChannelDialog.h \ Dialogs/QuantizeDialog.h \ +Dialogs/SearchAndReplaceDialog.h \ Dialogs/ShiftDialog.h \ Dialogs/SnapDialog.h \ Dialogs/SynthesizerSettingsDialog.h \ Dialogs/TrackDialog.h \ +Dialogs/TransposeDialog.h \ Dialogs/VelocityDialog.h \ Dialogs.h \ DynamicArray.h \ Modified: trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj =================================================================== --- trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-06-21 20:46:58 UTC (rev 731) +++ trunk/jazz/vc8/JazzPlusPlus-VC8.vcproj 2009-06-21 20:54:58 UTC (rev 732) @@ -47,7 +47,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.9-VC8\lib\vc_lib\mswd";"$(EXT_PKGS)\wxMSW-2.8.9-VC8\include";..\src;..\src\mswin" + AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.10-VC8\lib\vc_lib\mswd";"$(EXT_PKGS)\wxMSW-2.8.10-VC8\include";..\src;..\src\mswin" PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;WINVER=0x0400;STRICT;NOMINMAX;__WXDEBUG__;WXDEBUG=1" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -70,7 +70,7 @@ Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" - AdditionalIncludeDirectories="$(EXT_PKGS)\wxMSW-2.8.9-VC8\include" + AdditionalIncludeDirectories="$(EXT_PKGS)\wxMSW-2.8.10-VC8\include" /> <Tool Name="VCPreLinkEventTool" @@ -81,7 +81,7 @@ OutputFile=".\$(OutDir)\JazzPlusPlus.exe" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.9-VC8\lib\vc_lib"" + AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.10-VC8\lib\vc_lib"" IgnoreDefaultLibraryNames="" GenerateDebugInformation="true" ProgramDatabaseFile=".\$(OutDir)\JazzPlusPlus.pdb" @@ -147,7 +147,7 @@ Name="VCCLCompilerTool" Optimization="3" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.9-VC8\lib\vc_lib\msw";"$(EXT_PKGS)\wxMSW-2.8.9-VC8\include";..\src;..\src\mswin" + AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.10-VC8\lib\vc_lib\msw";"$(EXT_PKGS)\wxMSW-2.8.10-VC8\include";..\src;..\src\mswin" PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WINVER=0x0400;STRICT;NOMINMAX" StringPooling="true" RuntimeLibrary="2" @@ -171,7 +171,7 @@ Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" - AdditionalIncludeDirectories="$(EXT_PKGS)\wxMSW-2.8.9-VC8\include" + AdditionalIncludeDirectories="$(EXT_PKGS)\wxMSW-2.8.10-VC8\include" /> <Tool Name="VCPreLinkEventTool" @@ -182,7 +182,7 @@ OutputFile=".\$(OutDir)\JazzPlusPlus.exe" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.9-VC8\lib\vc_lib"" + AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.10-VC8\lib\vc_lib"" IgnoreDefaultLibraryNames="" ProgramDatabaseFile=".\$(OutDir)\JazzPlusPlus.pdb" SubSystem="2" @@ -899,6 +899,14 @@ > </File> <File + RelativePath="..\src\Dialogs\SearchAndReplaceDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\SearchAndReplaceDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\ShiftDialog.cpp" > </File> @@ -931,6 +939,14 @@ > </File> <File + RelativePath="..\src\Dialogs\TransposeDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\TransposeDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\VelocityDialog.cpp" > </File> Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-06-21 20:46:58 UTC (rev 731) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2009-06-21 20:54:58 UTC (rev 732) @@ -48,7 +48,7 @@ <Tool Name="VCCLCompilerTool" Optimization="0" - AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.9-VC9\lib\vc_lib\mswd";"$(EXT_PKGS)\wxMSW-2.8.9-VC9\include";..\src;..\src\mswin" + AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.10-VC9\lib\vc_lib\mswd";"$(EXT_PKGS)\wxMSW-2.8.10-VC9\include";..\src;..\src\mswin" PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;WINVER=0x0400;STRICT;NOMINMAX;__WXDEBUG__;WXDEBUG=1" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -72,7 +72,7 @@ Name="VCResourceCompilerTool" PreprocessorDefinitions="_DEBUG" Culture="1033" - AdditionalIncludeDirectories="$(EXT_PKGS)\wxMSW-2.8.9-VC9\include" + AdditionalIncludeDirectories="$(EXT_PKGS)\wxMSW-2.8.10-VC9\include" /> <Tool Name="VCPreLinkEventTool" @@ -83,7 +83,7 @@ OutputFile=".\$(OutDir)\JazzPlusPlus.exe" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.9-VC9\lib\vc_lib"" + AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.10-VC9\lib\vc_lib"" IgnoreDefaultLibraryNames="" GenerateDebugInformation="true" ProgramDatabaseFile=".\$(OutDir)\JazzPlusPlus.pdb" @@ -148,7 +148,7 @@ Name="VCCLCompilerTool" Optimization="3" InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.9-VC9\lib\vc_lib\msw";"$(EXT_PKGS)\wxMSW-2.8.9-VC9\include";..\src;..\src\mswin" + AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.10-VC9\lib\vc_lib\msw";"$(EXT_PKGS)\wxMSW-2.8.10-VC9\include";..\src;..\src\mswin" PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WINVER=0x0400;STRICT;NOMINMAX" StringPooling="true" RuntimeLibrary="2" @@ -173,7 +173,7 @@ Name="VCResourceCompilerTool" PreprocessorDefinitions="NDEBUG" Culture="1033" - AdditionalIncludeDirectories="$(EXT_PKGS)\wxMSW-2.8.9-VC9\include" + AdditionalIncludeDirectories="$(EXT_PKGS)\wxMSW-2.8.10-VC9\include" /> <Tool Name="VCPreLinkEventTool" @@ -184,7 +184,7 @@ OutputFile=".\$(OutDir)\JazzPlusPlus.exe" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.9-VC9\lib\vc_lib"" + AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.10-VC9\lib\vc_lib"" IgnoreDefaultLibraryNames="" ProgramDatabaseFile=".\$(OutDir)\JazzPlusPlus.pdb" SubSystem="2" @@ -828,7 +828,7 @@ <Tool Name="VCCustomBuildTool" Description="Performing Custom Help Build Step" - CommandLine="echo cd "$(InputDir)"
cd "$(InputDir)"
echo $(EXT_PKGS)\wxMSW-2.8.9-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
$(EXT_PKGS)\wxMSW-2.8.9-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
" + CommandLine="echo cd "$(InputDir)"
cd "$(InputDir)"
echo $(EXT_PKGS)\wxMSW-2.8.10-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
$(EXT_PKGS)\wxMSW-2.8.10-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
" Outputs="$(InputDir)$(InputName)_contents.html;$(InputDir)$(InputName).hhc;$(InputDir)$(InputName).hhp;$(InputDir)$(InputName).hhk;$(InputDir)$(InputName).ref;$(InputDir)$(InputName).con;$(InputDir)$(InputName).htx" /> </FileConfiguration> @@ -837,7 +837,7 @@ > <Tool Name="VCCustomBuildTool" - CommandLine="echo cd "$(InputDir)"
cd "$(InputDir)"
echo $(EXT_PKGS)\wxMSW-2.8.9-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
$(EXT_PKGS)\wxMSW-2.8.9-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
" + CommandLine="echo cd "$(InputDir)"
cd "$(InputDir)"
echo $(EXT_PKGS)\wxMSW-2.8.10-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
$(EXT_PKGS)\wxMSW-2.8.10-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
" Outputs="$(InputDir)$(InputName)_contents.html" /> </FileConfiguration> @@ -919,6 +919,14 @@ > </File> <File + RelativePath="..\src\Dialogs\SearchAndReplaceDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\SearchAndReplaceDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\ShiftDialog.cpp" > </File> @@ -951,6 +959,14 @@ > </File> <File + RelativePath="..\src\Dialogs\TransposeDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\TransposeDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\VelocityDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-01-07 15:14:34
|
Revision: 739 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=739&view=rev Author: pstieber Date: 2010-01-07 15:14:24 +0000 (Thu, 07 Jan 2010) Log Message: ----------- Updated the autotools files. Modified Paths: -------------- trunk/jazz/Makefile.am trunk/jazz/config/ltmain.sh trunk/jazz/configure.ac Added Paths: ----------- trunk/jazz/m4/ trunk/jazz/m4/acinclude.m4 trunk/jazz/m4/libtool.m4 trunk/jazz/m4/ltoptions.m4 trunk/jazz/m4/ltsugar.m4 trunk/jazz/m4/ltversion.m4 trunk/jazz/m4/lt~obsolete.m4 Removed Paths: ------------- trunk/jazz/config/acinclude.m4 Modified: trunk/jazz/Makefile.am =================================================================== --- trunk/jazz/Makefile.am 2009-12-03 14:43:42 UTC (rev 738) +++ trunk/jazz/Makefile.am 2010-01-07 15:14:24 UTC (rev 739) @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -ACLOCAL_FLAGS=-I config +ACLOCAL_AMFLAGS=-I m4 SUBDIRS = src conf Deleted: trunk/jazz/config/acinclude.m4 =================================================================== --- trunk/jazz/config/acinclude.m4 2009-12-03 14:43:42 UTC (rev 738) +++ trunk/jazz/config/acinclude.m4 2010-01-07 15:14:24 UTC (rev 739) @@ -1,370 +0,0 @@ -dnl --------------------------------------------------------------------------- -dnl Macros for the Jazz++ application configure.ac -dnl --------------------------------------------------------------------------- - -dnl --------------------------------------------------------------------------- -dnl Macros for wxWidgets detection. Typically used in configure.in as: -dnl -dnl AC_ARG_ENABLE(...) -dnl AC_ARG_WITH(...) -dnl ... -dnl AM_OPTIONS_WXCONFIG -dnl ... -dnl ... -dnl AM_PATH_WXCONFIG(2.6.0, wxWin=1) -dnl if test "$wxWin" != 1; then -dnl AC_MSG_ERROR([ -dnl wxWidgets must be installed on your system -dnl but wx-config script couldn't be found. -dnl -dnl Please check that wx-config is in path, the directory -dnl where wxWidgets libraries are installed (returned by -dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or -dnl equivalent variable and wxWidgets version is 2.3.4 or above. -dnl ]) -dnl fi -dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" -dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" -dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" -dnl -dnl LIBS="$LIBS $WX_LIBS" -dnl --------------------------------------------------------------------------- - -dnl --------------------------------------------------------------------------- -dnl AM_OPTIONS_WXCONFIG -dnl -dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and -dnl --wx-config command line options -dnl --------------------------------------------------------------------------- - -AC_DEFUN([AM_OPTIONS_WXCONFIG], -[ - AC_ARG_WITH(wxdir, - [ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH], - [ wx_config_name="$withval/wx-config" - wx_config_args="--inplace"]) - AC_ARG_WITH(wx-config, - [ --with-wx-config=CONFIG wx-config script to use (optional)], - wx_config_name="$withval" ) - AC_ARG_WITH(wx-prefix, - [ --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)], - wx_config_prefix="$withval", wx_config_prefix="") - AC_ARG_WITH(wx-exec-prefix, - [ --with-wx-exec-prefix=PREFIX - Exec prefix where wxWidgets is installed (optional)], - wx_config_exec_prefix="$withval", wx_config_exec_prefix="") -]) - -dnl Helper macro for checking if wx version is at least $1.$2.$3, set's -dnl wx_ver_ok=yes if it is: -AC_DEFUN([_WX_PRIVATE_CHECK_VERSION], -[ - wx_ver_ok="" - if test "x$WX_VERSION" != x ; then - if test $wx_config_major_version -gt $1; then - wx_ver_ok=yes - else - if test $wx_config_major_version -eq $1; then - if test $wx_config_minor_version -gt $2; then - wx_ver_ok=yes - else - if test $wx_config_minor_version -eq $2; then - if test $wx_config_micro_version -ge $3; then - wx_ver_ok=yes - fi - fi - fi - fi - fi - fi -]) - -dnl --------------------------------------------------------------------------- -dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND -dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]]) -dnl -dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC -dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME -dnl environment variable to override the default name of the wx-config script -dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this -dnl case the macro won't even waste time on tests for its existence. -dnl -dnl Optional WX-LIBS argument contains comma- or space-separated list of -dnl wxWidgets libraries to link against (it may include contrib libraries). If -dnl it is not specified then WX_LIBS and WX_LIBS_STATIC will contain flags to -dnl link with all of the core wxWidgets libraries. -dnl -dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config -dnl invocation command in present. It can be used to fine-tune lookup of -dnl best wxWidgets build available. -dnl -dnl Example use: -dnl AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net] -dnl [--unicode --debug]) -dnl --------------------------------------------------------------------------- - -dnl -dnl Get the cflags and libraries from the wx-config script -dnl -AC_DEFUN([AM_PATH_WXCONFIG], -[ - dnl do we have wx-config name: it can be wx-config or wxd-config or ... - if test x${WX_CONFIG_NAME+set} != xset ; then - WX_CONFIG_NAME=wx-config - fi - - if test "x$wx_config_name" != x ; then - WX_CONFIG_NAME="$wx_config_name" - fi - - dnl deal with optional prefixes - if test x$wx_config_exec_prefix != x ; then - wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix" - WX_LOOKUP_PATH="$wx_config_exec_prefix/bin" - fi - if test x$wx_config_prefix != x ; then - wx_config_args="$wx_config_args --prefix=$wx_config_prefix" - WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin" - fi - if test "$cross_compiling" = "yes"; then - wx_config_args="$wx_config_args --host=$host_alias" - fi - - dnl don't search the PATH if WX_CONFIG_NAME is absolute filename - if test -x "$WX_CONFIG_NAME" ; then - AC_MSG_CHECKING(for wx-config) - WX_CONFIG_PATH="$WX_CONFIG_NAME" - AC_MSG_RESULT($WX_CONFIG_PATH) - else - AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH") - fi - - if test "$WX_CONFIG_PATH" != "no" ; then - WX_VERSION="" - - min_wx_version=ifelse([$1], ,2.2.1,$1) - if test -z "$5" ; then - AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version]) - else - AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)]) - fi - - WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4" - - WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null` - wx_config_major_version=`echo $WX_VERSION | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - wx_config_minor_version=`echo $WX_VERSION | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - wx_config_micro_version=`echo $WX_VERSION | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - - wx_requested_major_version=`echo $min_wx_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - wx_requested_minor_version=`echo $min_wx_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - wx_requested_micro_version=`echo $min_wx_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - - _WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version], - [$wx_requested_minor_version], - [$wx_requested_micro_version]) - - if test -n "$wx_ver_ok"; then - - AC_MSG_RESULT(yes (version $WX_VERSION)) - WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs` - - dnl is this even still appropriate? --static is a real option now - dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is - dnl what the user actually wants, making this redundant at best. - dnl For now keep it in case anyone actually used it in the past. - AC_MSG_CHECKING([for wxWidgets static library]) - WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null` - if test "x$WX_LIBS_STATIC" = "x"; then - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(yes) - fi - - dnl starting with version 2.2.6 wx-config has --cppflags argument - wx_has_cppflags="" - if test $wx_config_major_version -gt 2; then - wx_has_cppflags=yes - else - if test $wx_config_major_version -eq 2; then - if test $wx_config_minor_version -gt 2; then - wx_has_cppflags=yes - else - if test $wx_config_minor_version -eq 2; then - if test $wx_config_micro_version -ge 6; then - wx_has_cppflags=yes - fi - fi - fi - fi - fi - - dnl starting with version 2.7.0 wx-config has --rescomp option - wx_has_rescomp="" - if test $wx_config_major_version -gt 2; then - wx_has_rescomp=yes - else - if test $wx_config_major_version -eq 2; then - if test $wx_config_minor_version -ge 7; then - wx_has_rescomp=yes - fi - fi - fi - if test "x$wx_has_rescomp" = x ; then - dnl cannot give any useful info for resource compiler - WX_RESCOMP= - else - WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp` - fi - - if test "x$wx_has_cppflags" = x ; then - dnl no choice but to define all flags like CFLAGS - WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags` - WX_CPPFLAGS=$WX_CFLAGS - WX_CXXFLAGS=$WX_CFLAGS - - WX_CFLAGS_ONLY=$WX_CFLAGS - WX_CXXFLAGS_ONLY=$WX_CFLAGS - else - dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS - WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags` - WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags` - WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags` - - WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"` - WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"` - fi - - ifelse([$2], , :, [$2]) - - else - - if test "x$WX_VERSION" = x; then - dnl no wx-config at all - AC_MSG_RESULT(no) - else - AC_MSG_RESULT(no (version $WX_VERSION is not new enough)) - fi - - WX_CFLAGS="" - WX_CPPFLAGS="" - WX_CXXFLAGS="" - WX_LIBS="" - WX_LIBS_STATIC="" - WX_RESCOMP="" - ifelse([$3], , :, [$3]) - - fi - else - - WX_CFLAGS="" - WX_CPPFLAGS="" - WX_CXXFLAGS="" - WX_LIBS="" - WX_LIBS_STATIC="" - WX_RESCOMP="" - - ifelse([$3], , :, [$3]) - - fi - - AC_SUBST(WX_CPPFLAGS) - AC_SUBST(WX_CFLAGS) - AC_SUBST(WX_CXXFLAGS) - AC_SUBST(WX_CFLAGS_ONLY) - AC_SUBST(WX_CXXFLAGS_ONLY) - AC_SUBST(WX_LIBS) - AC_SUBST(WX_LIBS_STATIC) - AC_SUBST(WX_VERSION) - AC_SUBST(WX_RESCOMP) -]) - -dnl --------------------------------------------------------------------------- -dnl Get information on the wxrc program for making C++, Python and xrs -dnl resource files. -dnl -dnl AC_ARG_ENABLE(...) -dnl AC_ARG_WITH(...) -dnl ... -dnl AM_OPTIONS_WXCONFIG -dnl ... -dnl AM_PATH_WXCONFIG(2.6.0, wxWin=1) -dnl if test "$wxWin" != 1; then -dnl AC_MSG_ERROR([ -dnl wxWidgets must be installed on your system -dnl but wx-config script couldn't be found. -dnl -dnl Please check that wx-config is in path, the directory -dnl where wxWidgets libraries are installed (returned by -dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or -dnl equivalent variable and wxWidgets version is 2.6.0 or above. -dnl ]) -dnl fi -dnl -dnl AM_PATH_WXRC([HAVE_WXRC=1], [HAVE_WXRC=0]) -dnl if test "x$HAVE_WXRC" != x1; then -dnl AC_MSG_ERROR([ -dnl The wxrc program was not installed or not found. -dnl -dnl Please check the wxWidgets installation. -dnl ]) -dnl fi -dnl -dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS" -dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY" -dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY" -dnl -dnl LDFLAGS="$LDFLAGS $WX_LIBS" -dnl --------------------------------------------------------------------------- - - - -dnl --------------------------------------------------------------------------- -dnl AM_PATH_WXRC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl -dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS -dnl resources. The variable WXRC will be set and substituted in the configure -dnl script and Makefiles. -dnl -dnl Example use: -dnl AM_PATH_WXRC([wxrc=1], [wxrc=0]) -dnl --------------------------------------------------------------------------- - -dnl -dnl wxrc program from the wx-config script -dnl -AC_DEFUN([AM_PATH_WXRC], -[ - AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler]) - - if test "x$WX_CONFIG_NAME" = x; then - AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.]) - else - - AC_MSG_CHECKING([for wxrc]) - - if test "x$WXRC" = x ; then - dnl wx-config --utility is a new addition to wxWidgets: - _WX_PRIVATE_CHECK_VERSION(2,5,3) - if test -n "$wx_ver_ok"; then - WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc` - fi - fi - - if test "x$WXRC" = x ; then - AC_MSG_RESULT([not found]) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT([$WXRC]) - ifelse([$1], , :, [$1]) - fi - - AC_SUBST(WXRC) - fi -]) Modified: trunk/jazz/config/ltmain.sh =================================================================== --- trunk/jazz/config/ltmain.sh 2009-12-03 14:43:42 UTC (rev 738) +++ trunk/jazz/config/ltmain.sh 2010-01-07 15:14:24 UTC (rev 739) @@ -1,52 +1,83 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <go...@gn...>, 1996 -# -# This program is free software; you can redistribute it and/or modify +# Generated from ltmain.m4sh. + +# ltmain.sh (GNU libtool) 2.2.6b +# Written by Gordon Matzigkeit <go...@gn...>, 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # -# This program is distributed in the hope that it will be useful, but +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... # -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print informational messages (default) +# --version print version information +# -h, --help print short or long help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.6b +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to <bug...@gn...>. -basename="s,^.*/,,g" - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - -# The name of this program: -progname=`echo "$progpath" | $SED $basename` -modename="$progname" - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=1.5.24 -TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)" +VERSION=2.2.6b +TIMESTAMP="" +package_revision=1.3017 -# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -60,99 +91,262 @@ BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit $EXIT_SUCCESS -fi - -default_mode= -help="Try \`$progname --help' for more information." -magic="%%%MAGIC variable%%%" -mkdir="mkdir" -mv="mv -f" -rm="rm -f" - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - SP2NL='tr \040 \012' - NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - SP2NL='tr \100 \n' - NL2SP='tr \r\n \100\100' - ;; -esac - -# NLS nuisances. +# NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). -# We save the old values to restore during execute mode. -for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C + save_$lt_var=\$$lt_var + $lt_var=C export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done +$lt_unset CDPATH + + + + + +: ${CP="cp -f"} +: ${ECHO="echo"} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="/bin/sed"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" -if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - $echo "$modename: not configured to build any kind of library" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi +dirname="s,/[^/]*$,," +basename="s,^.*/,," -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -duplicate_deps=no -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} -##################################### -# Shell function definitions: -# This seems to be the best place for them +# Generated shell functions inserted here. +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +# In the unlikely event $progname began with a '-', it would play havoc with +# func_echo (imagine progname=-n), so we prepend ./ in that case: +func_dirname_and_basename "$progpath" +progname=$func_basename_result +case $progname in + -*) progname=./$progname ;; +esac + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname${mode+: }$mode: $*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` + done + my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If @@ -161,7 +355,7 @@ { my_template="${TMPDIR-/tmp}/${1-$progname}" - if test "$run" = ":"; then + if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else @@ -170,486 +364,743 @@ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" - save_mktempdir_umask=`umask` - umask 0077 - $mkdir "$my_tmpdir" - umask $save_mktempdir_umask + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || { - $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 - exit $EXIT_FAILURE - } + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi - $echo "X$my_tmpdir" | $Xsed + $ECHO "X$my_tmpdir" | $Xsed } -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -func_win32_libid () +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () { - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - $SED -n -e '1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; esac - ;; - esac - $echo $win32_libid_type + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac } -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () { - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "X$1" | $Xsed \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case "$@ " in - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit $EXIT_FAILURE -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" } -# func_extract_an_archive dir oldlib -func_extract_an_archive () +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () { - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" + my_cmd="$1" + my_fail_exp="${2-:}" - $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" - $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 - exit $EXIT_FAILURE + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi fi } -# func_extract_archives gentop oldlib ... -func_extract_archives () + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () { - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - my_status="" + my_cmd="$1" + my_fail_exp="${2-:}" - $show "${rm}r $my_gentop" - $run ${rm}r "$my_gentop" - $show "$mkdir $my_gentop" - $run $mkdir "$my_gentop" - my_status=$? - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then - exit $my_status + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi fi +} - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - extracted_serial=`expr $extracted_serial + 1` - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - $show "${rm}r $my_xdir" - $run ${rm}r "$my_xdir" - $show "$mkdir $my_xdir" - $run $mkdir "$my_xdir" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then - exit $exit_status - fi - case $host in - *-darwin*) - $show "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - if test -z "$run"; then - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` - if test -n "$darwin_arches"; then - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - $show "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we have a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - lipo -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - ${rm}r unfat-$$ - cd "$darwin_orig_dir" - else - cd "$darwin_orig_dir" - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - fi # $run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - func_extract_archives_result="$my_oldobjs" + + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? } -# End of Shell function definitions -##################################### -# Darwin sucks -eval std_shrext=\"$shrext_cmds\" +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $SED -n '/^# Usage:/,/# -h/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + $ECHO + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} -disable_libs=no +# func_help +# Echo long help message to standard output and exit. +func_help () +{ + $SED -n '/^# Usage:/,/# Report bugs to/ { + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + }' < "$progpath" + exit $? +} -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + func_error "missing argument for $1" + exit_cmd=exit +} + +exit_cmd=: + + + + + +# Check that we have a working $ECHO. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell, and then maybe $ECHO will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<EOF +$* +EOF + exit $EXIT_SUCCESS +fi - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit $EXIT_FAILURE - ;; - esac +# Global variables. +# $mode is unset +nonopt= +execute_dlfiles= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac +opt_dry_run=false +opt_duplicate_deps=false +opt_silent=false +opt_debug=: - prev= - prevopt= - continue - fi +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} - --version) - echo "\ -$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP -Copyright (C) 2007 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $? - ;; +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + # Now print the configurations for the tags. for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done + exit $? - ;; +} - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" +# func_features +# Display the features supported by this script. +func_features () +{ + $ECHO "host: $host" if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" + $ECHO "enable shared libraries" else - $echo "disable shared libraries" + $ECHO "disable shared libraries" fi if test "$build_old_libs" = yes; then - $echo "enable static libraries" + $ECHO "enable static libraries" else - $echo "disable static libraries" + $ECHO "disable static libraries" fi + exit $? - ;; +} - --finish) mode="finish" ;; +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" - --preserve-dup-deps) duplicate_deps="yes" ;; + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" - --tag) - prevopt="--tag" - prev=tag - preserve_args="$preserve_args --tag" + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. +{ + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift ;; - - *) - nonopt="$arg" - break + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; esac -done -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi + # Parse non-mode specific arguments: + while test "$#" -gt 0; do + opt="$1" + shift -case $disable_libs in -no) - ;; -shared) - build_libtool_libs=no - build_old_libs=yes - ;; -static) - build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` - ;; -esac + case $opt in + --config) func_config ;; -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= + --debug) preserve_args="$preserve_args $opt" + func_echo "enabling shell trace mode" + opt_debug='set -x' + $opt_debug + ;; -if test -z "$show_help"; then + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" + shift + ;; - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + case $1 in + # Valid mode arguments: + clean) ;; + compile) ;; + execute) ;; + finish) ;; + install) ;; + link) ;; + relink) ;; + uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; + esac + + mode="$1" + shift + ;; + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" + opt_silent=: + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here + shift + ;; + + # Separate optargs to long options: + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + shift + ;; + + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --version) func_version ;; + + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; + esac + done + + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: ;; - *db | *dbx | *strace | *truss) - mode=execute + *) + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute + esac - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF fi - ;; - esac + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH fi +} + +## ----------- ## +## Main. ## +## ----------- ## + +$opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + test -z "$mode" && func_fatal_error "error: you must specify a MODE." + + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." + help="Try \`$progname --help --mode=$mode' for more information." +} - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_ltwrapper_scriptname_result="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + i... [truncated message content] |
From: <pst...@us...> - 2010-04-03 02:35:59
|
Revision: 741 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=741&view=rev Author: pstieber Date: 2010-04-03 02:35:53 +0000 (Sat, 03 Apr 2010) Log Message: ----------- Added a new sysex dialog. Modified Paths: -------------- trunk/jazz/src/Makefile.am trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/SysexDialog.cpp trunk/jazz/src/Dialogs/SysexDialog.h Added: trunk/jazz/src/Dialogs/SysexDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SysexDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-04-03 02:35:53 UTC (rev 741) @@ -0,0 +1,278 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "SysexDialog.h" + +#include "../Events.h" +#include "../Globals.h" +#include "../KeyStringConverters.h" +#include "../Knob.h" +#include "../Project.h" +#include "../Resources.h" + +#include <wx/button.h> +#include <wx/sizer.h> +#include <wx/stattext.h> +#include <wx/textctrl.h> + +#include <sstream> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZSysexDialog, wxDialog) + + EVT_KNOB_CHANGED(IDC_KB_VELOCITY, JZSysexDialog::OnVelocityChange) + + EVT_KNOB_CHANGED(IDC_KB_OFF_VELOCITY, JZSysexDialog::OnOffVelocityChange) + + EVT_KNOB_CHANGED(IDC_KB_CHANNEL, JZSysexDialog::OnChannelChange) + + EVT_BUTTON(wxID_HELP, JZSysexDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZSysexDialog::JZSysexDialog(tKeyOn* pEvent, wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Key On")), + mpEvent(pEvent), + mpPitchEdit(0), + mpVelocityValue(0), + mpVelocityKnob(0), + mpOffVelocityValue(0), + mpOffVelocityKnob(0), + mpLengthEdit(0), + mpChannelValue(0), + mpChannelKnob(0), + mpClockEdit(0) +{ + mpPitchEdit = new wxTextCtrl(this, wxID_ANY); + + mpVelocityValue = new wxStaticText(this, wxID_ANY, "000"); + + mpVelocityKnob = new JZKnob(this, IDC_KB_VELOCITY, 0, 0, 127); + + mpOffVelocityValue = new wxStaticText(this, wxID_ANY, "000"); + + mpOffVelocityKnob = new JZKnob(this, IDC_KB_OFF_VELOCITY, 0, 0, 127); + + mpLengthEdit = new wxTextCtrl(this, wxID_ANY); + + mpChannelValue = new wxStaticText(this, wxID_ANY, "00"); + + mpChannelKnob = new JZKnob(this, IDC_KB_CHANNEL, 0, 1, 16); + + mpClockEdit = new wxTextCtrl(this, wxID_ANY); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + wxFlexGridSizer* pFlexGridSizer; + + pFlexGridSizer = new wxFlexGridSizer(1, 2, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Pitch:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add(mpPitchEdit, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2); + + pFlexGridSizer = new wxFlexGridSizer(2, 3, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Velocity:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpVelocityValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpVelocityKnob, 0, wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Off Velocity:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpOffVelocityValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpOffVelocityKnob, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER); + + pFlexGridSizer = new wxFlexGridSizer(1, 2, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Length:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add(mpLengthEdit, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2); + + pFlexGridSizer = new wxFlexGridSizer(1, 3, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Channel:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpChannelValue, + 0, + wxALIGN_CENTER_VERTICAL | wxFIXED_MINSIZE); + pFlexGridSizer->Add(mpChannelKnob, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2); + + pFlexGridSizer = new wxFlexGridSizer(1, 2, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Clock:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add(mpClockEdit, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSysexDialog::TransferDataToWindow() +{ + string KeyString; + KeyToString(mpEvent->GetKey(), KeyString); + mpPitchEdit->ChangeValue(KeyString.c_str()); + + ostringstream Oss; + + Oss << (int)mpEvent->GetVelocity(); + mpVelocityValue->SetLabel(Oss.str().c_str()); + + mpVelocityKnob->SetValue(mpEvent->GetVelocity()); + + Oss.str(""); + Oss << (int)mpEvent->GetOffVelocity(); + mpOffVelocityValue->SetLabel(Oss.str().c_str()); + + mpOffVelocityKnob->SetValue(mpEvent->GetOffVelocity()); + + wxString LengthString; + LengthString << mpEvent->GetEventLength(); + mpLengthEdit->ChangeValue(LengthString); + + Oss.str(""); + Oss << (int)mpEvent->GetChannel() + 1; + mpChannelValue->SetLabel(Oss.str().c_str()); + + mpChannelKnob->SetValue(mpEvent->GetChannel() + 1); + + string ClockString; + gpProject->ClockToString(mpEvent->GetClock(), ClockString); + mpClockEdit->ChangeValue(ClockString.c_str()); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSysexDialog::TransferDataFromWindow() +{ + wxString KeyString = mpPitchEdit->GetValue(); + mpEvent->SetKey(StringToKey(KeyString.c_str())); + + mpEvent->SetVelocity(mpVelocityKnob->GetValue()); + + mpEvent->SetOffVelocity(mpOffVelocityKnob->GetValue()); + + wxString LengthString = mpLengthEdit->GetValue(); + istringstream Iss(LengthString.c_str()); + unsigned short Length; + Iss >> Length; + mpEvent->SetLength(Length); + + mpEvent->SetChannel(mpChannelKnob->GetValue() - 1); + + wxString ClockString = mpClockEdit->GetValue(); + int Clock = gpProject->StringToClock(ClockString.c_str()); + mpEvent->SetClock(Clock); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSysexDialog::OnVelocityChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpVelocityValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSysexDialog::OnOffVelocityChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpOffVelocityValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSysexDialog::OnChannelChange(JZKnobEvent& Event) +{ + int Value = Event.GetValue(); + ostringstream Oss; + Oss << Value; + mpChannelValue->SetLabel(Oss.str().c_str()); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSysexDialog::OnHelp(wxCommandEvent& Event) +{ +// gpHelpInstance->ShowTopic("Sysex Dialog"); +} Property changes on: trunk/jazz/src/Dialogs/SysexDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/SysexDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SysexDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/SysexDialog.h 2010-04-03 02:35:53 UTC (rev 741) @@ -0,0 +1,71 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2009 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_SYSEXDIALOG_H +#define JZ_SYSEXDIALOG_H + +#include <wx/dialog.h> + +class JZKnob; +class JZKnobEvent; +class tKeyOn; +class wxStaticText; +class wxTextCtrl; + +//***************************************************************************** +//***************************************************************************** +class JZSysexDialog : public wxDialog +{ + public: + + JZSysexDialog(tKeyOn* pEvent, wxWindow* pParent); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnVelocityChange(JZKnobEvent& Event); + + void OnOffVelocityChange(JZKnobEvent& Event); + + void OnChannelChange(JZKnobEvent& Event); + + void OnHelp(wxCommandEvent& Event); + + private: + + tKeyOn* mpEvent; + + wxTextCtrl* mpPitchEdit; + wxStaticText* mpVelocityValue; + JZKnob* mpVelocityKnob; + wxStaticText* mpOffVelocityValue; + JZKnob* mpOffVelocityKnob; + wxTextCtrl* mpLengthEdit; + wxStaticText* mpChannelValue; + JZKnob* mpChannelKnob; + wxTextCtrl* mpClockEdit; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_SYSEXDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/SysexDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2010-02-21 17:41:53 UTC (rev 740) +++ trunk/jazz/src/Makefile.am 2010-04-03 02:35:53 UTC (rev 741) @@ -35,6 +35,7 @@ Dialogs/ShiftDialog.cpp \ Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ +Dialogs/SysexDialog.cpp \ Dialogs/TrackDialog.cpp \ Dialogs/TransposeDialog.cpp \ Dialogs/VelocityDialog.cpp \ @@ -123,6 +124,7 @@ Dialogs/ShiftDialog.cpp \ Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ +Dialogs/SysexDialog.cpp \ Dialogs/TrackDialog.cpp \ Dialogs/TransposeDialog.cpp \ Dialogs/VelocityDialog.cpp \ @@ -216,6 +218,7 @@ Dialogs/ShiftDialog.h \ Dialogs/SnapDialog.h \ Dialogs/SynthesizerSettingsDialog.h \ +Dialogs/SysexDialog.h \ Dialogs/TrackDialog.h \ Dialogs/TransposeDialog.h \ Dialogs/VelocityDialog.h \ Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-02-21 17:41:53 UTC (rev 740) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-03 02:35:53 UTC (rev 741) @@ -951,6 +951,14 @@ > </File> <File + RelativePath="..\src\Dialogs\SysexDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\SysexDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\TrackDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-25 04:42:47
|
Revision: 752 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=752&view=rev Author: pstieber Date: 2010-04-25 04:42:41 +0000 (Sun, 25 Apr 2010) Log Message: ----------- replaced old Program Channel dialog with a new version. This still isn't functional. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Makefile.am trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp trunk/jazz/src/Dialogs/ProgramChangeDialog.h Added: trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp 2010-04-25 04:42:41 UTC (rev 752) @@ -0,0 +1,59 @@ +#include "ProgramChangeDialog.h" + +#include "../Configuration.h" +#include "../Globals.h" + +#include <wx/button.h> +#include <wx/listbox.h> +#include <wx/sizer.h> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZProgramChangeDialog, wxDialog) +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZProgramChangeDialog::JZProgramChangeDialog(wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Program Change")), + mpProgramListBox(0) +{ + mpProgramListBox = new wxListBox(this, wxID_ANY); + + const vector<pair<string, int> >& VoiceNames = gpConfig->GetVoiceNames(); + for ( + vector<pair<string, int> >::const_iterator iName = VoiceNames.begin(); + iName != VoiceNames.end(); + ++iName) + { + mpProgramListBox->Append(iName->first.c_str()); + } + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + pTopSizer->Add(mpProgramListBox, 0, wxGROW | wxALL, 2); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + Property changes on: trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/ProgramChangeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/ProgramChangeDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2010-04-25 04:42:41 UTC (rev 752) @@ -0,0 +1,43 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_PROGRAMCHANGEDIALOG_H +#define JZ_PROGRAMCHANGEDIALOG_H + +#include <wx/dialog.h> + +class wxListBox; + +//***************************************************************************** +//***************************************************************************** +class JZProgramChangeDialog : public wxDialog +{ + public: + + JZProgramChangeDialog(wxWindow* pParent); + + private: + + wxListBox* mpProgramListBox; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_PROGRAMCHANGEDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/ProgramChangeDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2010-04-25 03:54:05 UTC (rev 751) +++ trunk/jazz/src/Dialogs.cpp 2010-04-25 04:42:41 UTC (rev 752) @@ -26,6 +26,7 @@ #include "Command.h" #include "DeprecatedWx/proplist.h" #include "Dialogs/KeyOnDialog.h" +#include "Dialogs/ProgramChangeDialog.h" //#include "EventFrame.h" #include "Events.h" #include "EventWindow.h" @@ -590,11 +591,12 @@ } +#ifdef DEPRECATED // -------------------------------- Program --------------------------- class tProgramDlg : public tEventDlg { - public: +public: int Program; // tNamedChoice Choice; @@ -635,6 +637,7 @@ "props", new tNamedValueListValidator(gpConfig->GetVoiceNames()))); } +#endif // DEPRECATED @@ -948,8 +951,12 @@ break; case StatProgram: - str = "Program Change"; - dlg = new tProgramDlg(e->IsProgram(), pPianoWindow, t); + { +// str = "Program Change"; +// dlg = new tProgramDlg(e->IsProgram(), pPianoWindow, t); + JZProgramChangeDialog ProgramChangeDialog(pPianoWindow); + ProgramChangeDialog.ShowModal(); + } break; case StatSetTempo: Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2010-04-25 03:54:05 UTC (rev 751) +++ trunk/jazz/src/Makefile.am 2010-04-25 04:42:41 UTC (rev 752) @@ -30,6 +30,7 @@ Dialogs/KeyOnDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/MidiChannelDialog.cpp \ +Dialogs/ProgramChannelDialog.cpp \ Dialogs/QuantizeDialog.cpp \ Dialogs/SearchAndReplaceDialog.cpp \ Dialogs/ShiftDialog.cpp \ @@ -119,6 +120,7 @@ Dialogs/KeyOnDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/MidiChannelDialog.cpp \ +Dialogs/ProgramChannelDialog.cpp \ Dialogs/QuantizeDialog.cpp \ Dialogs/SearchAndReplaceDialog.cpp \ Dialogs/ShiftDialog.cpp \ @@ -213,6 +215,7 @@ Dialogs/KeyOnDialog.h \ Dialogs/MetronomeSettingsDialog.h \ Dialogs/MidiChannelDialog.h \ +Dialogs/ProgramChannelDialog.h \ Dialogs/QuantizeDialog.h \ Dialogs/SearchAndReplaceDialog.h \ Dialogs/ShiftDialog.h \ Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-25 03:54:05 UTC (rev 751) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-25 04:42:41 UTC (rev 752) @@ -911,6 +911,14 @@ > </File> <File + RelativePath="..\src\Dialogs\ProgramChangeDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\ProgramChangeDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\QuantizeDialog.cpp" > </File> @@ -983,6 +991,10 @@ > </File> </Filter> + <File + RelativePath="..\src\Makefile.am" + > + </File> </Files> <Globals> </Globals> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-25 05:19:21
|
Revision: 754 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=754&view=rev Author: pstieber Date: 2010-04-25 05:19:15 +0000 (Sun, 25 Apr 2010) Log Message: ----------- 1. Replaced old Controller dialog with a new version. This still isn't functional. 2. Removed the tNamedValueListValidator class. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/Makefile.am trunk/jazz/src/PropertyListDialog.cpp trunk/jazz/src/PropertyListDialog.h trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/ControllerDialog.cpp trunk/jazz/src/Dialogs/ControllerDialog.h Added: trunk/jazz/src/Dialogs/ControllerDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/ControllerDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/ControllerDialog.cpp 2010-04-25 05:19:15 UTC (rev 754) @@ -0,0 +1,58 @@ +#include "ControllerDialog.h" + +#include "../Configuration.h" +#include "../Globals.h" + +#include <wx/button.h> +#include <wx/listbox.h> +#include <wx/sizer.h> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZControllerDialog, wxDialog) +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZControllerDialog::JZControllerDialog(wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Controller")), + mpControllerListBox(0) +{ + mpControllerListBox = new wxListBox(this, wxID_ANY); + + const vector<pair<string, int> >& VoiceNames = gpConfig->GetControlNames(); + for ( + vector<pair<string, int> >::const_iterator iName = VoiceNames.begin(); + iName != VoiceNames.end(); + ++iName) + { + mpControllerListBox->Append(iName->first.c_str()); + } + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + pTopSizer->Add(mpControllerListBox, 0, wxGROW | wxALL, 2); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} Property changes on: trunk/jazz/src/Dialogs/ControllerDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/ControllerDialog.h =================================================================== --- trunk/jazz/src/Dialogs/ControllerDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/ControllerDialog.h 2010-04-25 05:19:15 UTC (rev 754) @@ -0,0 +1,44 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_CONTROLLERDIALOG_H +#define JZ_CONTROLLERDIALOG_H + + +#include <wx/dialog.h> + +class wxListBox; + +//***************************************************************************** +//***************************************************************************** +class JZControllerDialog : public wxDialog +{ + public: + + JZControllerDialog(wxWindow* pParent); + + private: + + wxListBox* mpControllerListBox; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_CONTROLLERDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/ControllerDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2010-04-25 05:07:21 UTC (rev 753) +++ trunk/jazz/src/Dialogs.cpp 2010-04-25 05:19:15 UTC (rev 754) @@ -25,6 +25,7 @@ #include "ClockDialog.h" #include "Command.h" #include "DeprecatedWx/proplist.h" +#include "Dialogs/ControllerDialog.h" #include "Dialogs/KeyOnDialog.h" #include "Dialogs/ProgramChangeDialog.h" //#include "EventFrame.h" @@ -107,43 +108,43 @@ // SearchReplace //***************************************************************************** -int tSearchReplaceDlg::frCtrl = 1; -int tSearchReplaceDlg::toCtrl = 1; +//int tSearchReplaceDlg::frCtrl = 1; +//int tSearchReplaceDlg::toCtrl = 1; +// +//tSearchReplaceDlg::tSearchReplaceDlg(JZEventWindow* w, JZFilter *f) +// : tPropertyListDlg("Search and replace controller types" ) +//{ +// Filter = f; +// Song = f->GetSong(); +//} -tSearchReplaceDlg::tSearchReplaceDlg(JZEventWindow* w, JZFilter *f) - : tPropertyListDlg("Search and replace controller types" ) -{ - Filter = f; - Song = f->GetSong(); -} +//bool tSearchReplaceDlg::OnClose() +//{ +// tCmdSearchReplace sr(Filter, frCtrl - 1, toCtrl-1); +// sr.Execute(); +// +// JZProjectManager::Instance()->UpdateAllViews(); +// +// return false; +//} -bool tSearchReplaceDlg::OnClose() -{ - tCmdSearchReplace sr(Filter, frCtrl - 1, toCtrl-1); - sr.Execute(); +//void tSearchReplaceDlg::AddProperties() +//{ +// sheet->AddProperty(new wxProperty( +// "Search", +// tNamedValueListValue(&frCtrl, gpConfig->GetControlNames()), +// "props", +// new tNamedValueListValidator(gpConfig->GetControlNames()))); +// +// sheet->AddProperty(new wxProperty( +// "Replace", +// tNamedValueListValue(&toCtrl, gpConfig->GetControlNames()), +// "props", +// new tNamedValueListValidator(gpConfig->GetControlNames()))); +//} - JZProjectManager::Instance()->UpdateAllViews(); - return false; -} -void tSearchReplaceDlg::AddProperties() -{ - sheet->AddProperty(new wxProperty( - "Search", - tNamedValueListValue(&frCtrl, gpConfig->GetControlNames()), - "props", - new tNamedValueListValidator(gpConfig->GetControlNames()))); - - sheet->AddProperty(new wxProperty( - "Replace", - tNamedValueListValue(&toCtrl, gpConfig->GetControlNames()), - "props", - new tNamedValueListValidator(gpConfig->GetControlNames()))); -} - - - //***************************************************************************** // seqLength //***************************************************************************** @@ -385,66 +386,6 @@ tChEventDlg::AddProperties(); } -// -------------------------------- Controller --------------------------- - -class tControlDlg : public tChEventDlg -{ - public: - - int Value; - int Control; - //tNamedChoice Choice; - - tControlDlg(tControl *e, JZPianoWindow* w, JZTrack *t); - - void AddProperties(); - bool OnClose(); -}; - - -tControlDlg::tControlDlg(tControl* pControl, JZPianoWindow* w, JZTrack *t) - : tChEventDlg(pControl, w, t)//, -// Choice("Controller", &gpConfig->GetCtrlName(0), &Control) -{ - Event = pControl; - Value = pControl->GetControlValue(); - Control = pControl->GetControl() + 1; -} - - -bool tControlDlg::OnClose() -{ - ((tControl *)Copy)->SetControlValue(Value); - // Choice.GetValue(); - ((tControl *)Copy)->SetControl(Control - 1); - return tChEventDlg::OnClose(); -} - -void tControlDlg::AddProperties() -{ - // Add(Choice.mkFormItem(300, 300)); -// Choice("Controller", &gpConfig->GetCtrlName(0), &Control) - sheet->AddProperty(new wxProperty( - "Controller", - tNamedValueListValue(&Control, gpConfig->GetControlNames()), - "props", - new tNamedValueListValidator(gpConfig->GetControlNames()))); - - sheet->AddProperty(new wxProperty( - "Value", - wxPropertyValue(&Value), - "integer", - new wxIntegerListValidator(0, 127))); - -// Add(wxMakeFormShort( -// "Value:", -// &Value, -// wxFORM_DEFAULT, -// new wxList(wxMakeConstraintRange(0.0, 127.0), 0))); - - tChEventDlg::AddProperties(); -} - // -------------------------------- Play track --------------------------- class tPlayTrackDlg : public tEventDlg @@ -591,56 +532,7 @@ } -#ifdef DEPRECATED -// -------------------------------- Program --------------------------- -class tProgramDlg : public tEventDlg -{ -public: - - int Program; - // tNamedChoice Choice; - - tProgramDlg(tProgram *e, JZPianoWindow* w, JZTrack *t); - - void AddProperties(); - bool OnClose(); -}; - - -tProgramDlg::tProgramDlg(tProgram* pProgram, JZPianoWindow* w, JZTrack *t) - : tEventDlg(pProgram, w, t), - Program(pProgram->GetProgram() + 1)//, -// Choice("Program", &gpConfig->GetVoiceName(0), &Program) -{ - Event = pProgram; -} - - -bool tProgramDlg::OnClose() -{ -// Choice.GetValue(); - if (Program <= 0) - { - Program = 1; - } - ((tProgram *)Copy)->SetProgram(Program - 1); - return tEventDlg::OnClose(); -} - -void tProgramDlg::AddProperties() -{ - //Add(Choice.mkFormItem(300, 300)); - sheet->AddProperty(new wxProperty( - "Program", - tNamedValueListValue(&Program, gpConfig->GetVoiceNames()), - "props", - new tNamedValueListValidator(gpConfig->GetVoiceNames()))); -} -#endif // DEPRECATED - - - // -------------------------------- Set Tempo ------------------------------- class tSetTempoDlg : public tEventDlg @@ -946,16 +838,20 @@ break; case StatControl: - str = "Controller"; - dlg = new tControlDlg(e->IsControl(), pPianoWindow, t); +// str = "Controller"; +// dlg = new tControlDlg(e->IsControl(), pPianoWindow, t); + { + JZControllerDialog ControllerDialog(pPianoWindow); + ControllerDialog.ShowModal(); + } break; case StatProgram: - { // str = "Program Change"; // dlg = new tProgramDlg(e->IsProgram(), pPianoWindow, t); - JZProgramChangeDialog ProgramChangeDialog(pPianoWindow); - ProgramChangeDialog.ShowModal(); + { + JZProgramChangeDialog ProgramChangeDialog(pPianoWindow); + ProgramChangeDialog.ShowModal(); } break; Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2010-04-25 05:07:21 UTC (rev 753) +++ trunk/jazz/src/Dialogs.h 2010-04-25 05:19:15 UTC (rev 754) @@ -50,24 +50,24 @@ // void OnHelp(); //}; -class tSearchReplaceDlg : public tPropertyListDlg -{ - public: +//class tSearchReplaceDlg : public tPropertyListDlg +//{ +// public: +// +// static int frCtrl; +// static int toCtrl; +///* tNamedChoice frList; */ +///* tNamedChoice toList; */ +// +// JZFilter *Filter; +// JZSong *Song; +// +// tSearchReplaceDlg(JZEventWindow* w, JZFilter *f); +// void AddProperties(); +// bool OnClose(); +// void OnHelp(); +//}; - static int frCtrl; - static int toCtrl; -/* tNamedChoice frList; */ -/* tNamedChoice toList; */ - - JZFilter *Filter; - JZSong *Song; - - tSearchReplaceDlg(JZEventWindow* w, JZFilter *f); - void AddProperties(); - bool OnClose(); - void OnHelp(); -}; - // seqLength class tSeqLengthDlg : public tPropertyListDlg { Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2010-04-25 05:07:21 UTC (rev 753) +++ trunk/jazz/src/Makefile.am 2010-04-25 05:19:15 UTC (rev 754) @@ -23,6 +23,7 @@ DeprecatedWx/propform.cpp \ DeprecatedWx/proplist.cpp \ Dialogs/CleanupDialog.cpp \ +Dialogs/ControllerDialog.cpp \ Dialogs/DeleteDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ @@ -113,6 +114,7 @@ DeprecatedWx/propform.cpp \ DeprecatedWx/proplist.cpp \ Dialogs/CleanupDialog.cpp \ +Dialogs/ControllerDialog.cpp \ Dialogs/DeleteDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ @@ -208,6 +210,7 @@ DeprecatedWx/proplist.h \ DeprecatedStringUtils.h \ Dialogs/CleanupDialog.h \ +Dialogs/ControllerDialog.h \ Dialogs/DeleteDialog.h \ Dialogs/FilterDialog.h \ Dialogs/IntegerEdit.h \ Modified: trunk/jazz/src/PropertyListDialog.cpp =================================================================== --- trunk/jazz/src/PropertyListDialog.cpp 2010-04-25 05:07:21 UTC (rev 753) +++ trunk/jazz/src/PropertyListDialog.cpp 2010-04-25 05:19:15 UTC (rev 754) @@ -223,223 +223,3 @@ << "tPropertyListDlg::AddProperties should never be called, override!" << endl; } - -///////////////////////////////////////////////////////////// -// in constructor: init the delegate with strings from the nam/value array - -// map integer on string and show it - -// map string on integer and store it - -tNamedValueListValidator::tNamedValueListValidator( - const vector<pair<string, int> >& Values) - : mValues(Values) -{ - wxStringList* stringlist = new wxStringList(); - for ( - vector<pair<string, int> >::const_iterator iValue = mValues.begin(); - iValue != mValues.end(); - ++iValue) - { - // omit empty entries - if (!iValue->first.empty()) - { - stringlist->Add(wxString(iValue->first.c_str())); - } - } - - // copied from base(cant call base constructors) - m_strings = stringlist; - - // If no constraint, we just allow the string to be edited. - if (!m_strings && ((m_validatorFlags & wxPROP_ALLOW_TEXT_EDITING) == 0)) - { - m_validatorFlags |= wxPROP_ALLOW_TEXT_EDITING; - } -} - -tNamedValueListValidator::~tNamedValueListValidator() -{ -} - -int tNamedValueListValidator::MapName2Value(const char* Selection) -{ - int Result = 0; - - if (Selection) - { - for ( - vector<pair<string, int> >::const_iterator iValue = mValues.begin(); - iValue != mValues.end(); - ++iValue) - { - if (!strcmp(Selection, iValue->first.c_str())) - { - Result = iValue->second; - break; - } - } - } - return Result; -} - - -wxString tNamedValueListValidator::MapValue2Name(int value) -{ - for ( - vector<pair<string, int> >::const_iterator iValue = mValues.begin(); - iValue != mValues.end(); - ++iValue) - { - if (value == iValue->second) - { - return wxString(iValue->first.c_str()); - } - } - return ::wxEmptyString; -} - -// it appears not to be possible to get the validator to provide the value to -// be displayed in the property list. -// wxPropertyValue.GetStringRepresentation() is used for that. - -// fetch property value and display it -bool tNamedValueListValidator::OnDisplayValue( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParent) -{ - if (!pView->GetValueText()) - { - return false; - } - - // fetch the int value of the property, convert it to a name - wxString str=MapValue2Name(pProperty->GetValue().IntegerValue()); - - pView->GetValueText()->SetValue(str); - cout << "tNamedValueListValidator::OnDisplayValue " << str <<endl; - if ( - m_strings && - pView->GetValueList() && - pView->GetValueList()->IsShown() && - pView->GetValueList()->GetCount() > 0) - { - pView->GetValueList()->SetStringSelection(str); - } - return true; - -// return wxStringListValidator::OnDisplayValue(pProperty, pView, pParent); -} - -// update the property from the control -bool tNamedValueListValidator::OnRetrieveValue( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParent) -{ - if (!pView->GetValueText()) - { - return false; - } - wxString value(pView->GetValueText()->GetValue()); - pProperty->GetValue() = (long)MapName2Value(value); - cout - << "tNamedValueListValidator::OnRetrieveValue " - << pProperty->GetValue().IntegerValue() - << endl; -// pView->GetValueText()->SetValue("apa!"); - - return true; - -// return wxStringListValidator::OnRetrieveValue(pProperty, pView, pParent); -} - - -bool tNamedValueListValidator::OnSelect( - bool select, - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParent) -{ - return wxStringListValidator::OnSelect(select, pProperty, pView, pParent); -} - -bool tNamedValueListValidator::OnDoubleClick( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParent) -{ - return wxStringListValidator::OnDoubleClick(pProperty, pView, pParent); -} - -bool tNamedValueListValidator::OnValueListSelect( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParent) -{ - wxString s(pView->GetValueList()->GetStringSelection()); - cout <<"tNamedValueListValidator::OnValueListSelect "<<s<<endl; - if (s != wxT("")) - { - pView->GetValueText()->SetValue(s); - pView->RetrieveProperty(pProperty); //i think this displays the prop - } - return true; - -// return wxStringListValidator::OnValueListSelect(pProperty, pView, pParent); -} - -bool tNamedValueListValidator::OnPrepareControls( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParent) -{ - return wxStringListValidator::OnPrepareControls(pProperty, pView, pParent); -} - -bool tNamedValueListValidator::OnClearControls( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParent) -{ - return wxStringListValidator::OnClearControls(pProperty, pView, pParent); -} - -bool tNamedValueListValidator::OnPrepareDetailControls( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParent) -{ - return wxStringListValidator::OnPrepareDetailControls( - pProperty, - pView, - pParent); -} - -bool tNamedValueListValidator::OnClearDetailControls( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParent) -{ - return wxStringListValidator::OnClearDetailControls( - pProperty, - pView, - pParent); -} - -void tNamedValueListValidator::OnEdit( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParent) -{ - return wxStringListValidator::OnEdit(pProperty, pView, pParent); -} - -bool tNamedValueListValidator::OnCheckValue( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParent) -{ - return wxStringListValidator::OnCheckValue(pProperty, pView, pParent); -} Modified: trunk/jazz/src/PropertyListDialog.h =================================================================== --- trunk/jazz/src/PropertyListDialog.h 2010-04-25 05:07:21 UTC (rev 753) +++ trunk/jazz/src/PropertyListDialog.h 2010-04-25 05:19:15 UTC (rev 754) @@ -35,140 +35,29 @@ #ifndef JZ_PROPERTYLISTDIALOG_H #define JZ_PROPERTYLISTDIALOG_H -#include "NamedValue.h" #include "DeprecatedWx/proplist.h" #include "DeprecatedWx/propform.h" -#include <vector> -#include <string> - -class tNamedValueListValue : public wxPropertyValue +class tPropertyListDlg { -// DECLARE_DYNAMIC_CLASS(tNamedValueListValue) - public: -// tNamedValueListValue() -// : wxPropertyValue() -// { -// } - - tNamedValueListValue( - int* pValue, - const std::vector<std::pair<std::string, int> >& Pairs) - : wxPropertyValue(pValue), - mPairs(Pairs) + tPropertyListDlg(wxString title); + virtual ~tPropertyListDlg() { } + virtual void AddProperties(); + void Create(); + void CreateModal(); + virtual bool OnClose(); + virtual void OnPropertyChanged(wxProperty* pProperty); - //overriding these doesnt really work in the display area -/* virtual wxString GetStringRepresentation(void){ */ -/* cout <<"GetStringRepresentation"<<endl; */ -/* return wxString("apa"); */ -/* } */ -/* int IntegerValue(){ */ -/* return 42; */ -/* } */ + protected: - private: - -// tNamedValue* nval; - const std::vector<std::pair<std::string, int> >& mPairs; + wxPropertySheet* sheet; + wxPropertyListView* view; + wxPropertyValidatorRegistry *myListValidatorRegistry;//cannot be a temporary! leads to a crash + wxString title; }; - -class tPropertyListDlg -{ - public: - tPropertyListDlg(wxString title); - virtual ~tPropertyListDlg() - { - } - virtual void AddProperties(); - void Create(); - void CreateModal(); - virtual bool OnClose(); - virtual void OnPropertyChanged(wxProperty* pProperty); - protected: - wxPropertySheet* sheet; - wxPropertyListView* view; - wxPropertyValidatorRegistry *myListValidatorRegistry;//cannot be a temporary! leads to a crash - wxString title; - -}; - -class tNamedValueListValidator : public wxStringListValidator -{ - public: - - tNamedValueListValidator( - const std::vector<std::pair<std::string, int> >& Values); - - ~tNamedValueListValidator(); - - int MapName2Value(const char* pSelection); - - wxString MapValue2Name(int Value); - - virtual bool OnSelect( - bool Select, - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParentWindow); - - virtual bool OnDoubleClick( - wxProperty* WXUNUSED(pProperty), - wxPropertyListView* WXUNUSED(pView), - wxWindow* WXUNUSED(pParentWindow)); - - virtual bool OnValueListSelect( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParentWindow); - - virtual bool OnPrepareControls( - wxProperty* WXUNUSED(pProperty), - wxPropertyListView* WXUNUSED(pView), - wxWindow* WXUNUSED(pParentWindow)); - - virtual bool OnClearControls( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParentWindow); - - virtual bool OnPrepareDetailControls( - wxProperty* WXUNUSED(pProperty), - wxPropertyListView* WXUNUSED(pView), - wxWindow* WXUNUSED(pParentWindow)); - - virtual bool OnClearDetailControls( - wxProperty* WXUNUSED(pProperty), - wxPropertyListView* WXUNUSED(pView), - wxWindow* WXUNUSED(pParentWindow)); - - virtual void OnEdit( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParentWindow); - - virtual bool OnCheckValue( - wxProperty* WXUNUSED(pProperty), - wxPropertyListView* WXUNUSED(pView), - wxWindow* WXUNUSED(pParentWindow)); - - virtual bool OnRetrieveValue( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow* pParentWindow); - - virtual bool OnDisplayValue( - wxProperty* pProperty, - wxPropertyListView* pView, - wxWindow *pParentWindow); - - private: - - const std::vector<std::pair<std::string, int> >& mValues; -}; - #endif // !defined(JZ_PROPERTYLISTDIALOG_H) Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-25 05:07:21 UTC (rev 753) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-25 05:19:15 UTC (rev 754) @@ -855,6 +855,14 @@ > </File> <File + RelativePath="..\src\Dialogs\ControllerDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\ControllerDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\DeleteDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-26 02:08:58
|
Revision: 757 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=757&view=rev Author: pstieber Date: 2010-04-26 02:08:50 +0000 (Mon, 26 Apr 2010) Log Message: ----------- 1. Added new versions of the set temp and meter change dialog boxes. 2. Removed the old settings dialog. 3. Added the Misc menu to the track frame. Modified Paths: -------------- trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Dialogs.h trunk/jazz/src/EventFrame.cpp trunk/jazz/src/EventWindow.cpp trunk/jazz/src/EventWindow.h trunk/jazz/src/Makefile.am trunk/jazz/src/PianoFrame.cpp trunk/jazz/src/Resources.h trunk/jazz/src/TrackFrame.cpp trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/MeterChangeDialog.cpp trunk/jazz/src/Dialogs/MeterChangeDialog.h trunk/jazz/src/Dialogs/SetTempoDialog.cpp trunk/jazz/src/Dialogs/SetTempoDialog.h Added: trunk/jazz/src/Dialogs/MeterChangeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/MeterChangeDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/MeterChangeDialog.cpp 2010-04-26 02:08:50 UTC (rev 757) @@ -0,0 +1,82 @@ +#include "MeterChangeDialog.h" + +#include "../Globals.h" +#include "../Help.h" + +#include <wx/button.h> +#include <wx/combobox.h> +#include <wx/sizer.h> + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZMeterChangeDialog, wxDialog) + + EVT_BUTTON(wxID_HELP, JZMeterChangeDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZMeterChangeDialog::JZMeterChangeDialog(wxWindow* pParent) + : wxDialog(pParent, wxID_ANY, wxString("Meter Change")), + mpNumeratorComboBox(0), + mpDenominatorComboBox(0) +{ + mpNumeratorComboBox = new wxComboBox(this, wxID_ANY); + mpNumeratorComboBox->Append("1"); + mpNumeratorComboBox->Append("2"); + mpNumeratorComboBox->Append("3"); + mpNumeratorComboBox->Append("4"); + mpNumeratorComboBox->Append("5"); + mpNumeratorComboBox->Append("6"); + mpNumeratorComboBox->Append("7"); + mpNumeratorComboBox->Append("8"); + mpNumeratorComboBox->Append("9"); + mpNumeratorComboBox->Append("10"); + mpNumeratorComboBox->Append("11"); + mpNumeratorComboBox->Append("12"); + mpNumeratorComboBox->Append("13"); + mpNumeratorComboBox->Append("14"); + mpNumeratorComboBox->Append("15"); + mpNumeratorComboBox->Append("16"); + mpNumeratorComboBox->Append("17"); + + mpDenominatorComboBox = new wxComboBox(this, wxID_ANY); + mpDenominatorComboBox->Append("2"); + mpDenominatorComboBox->Append("4"); + mpDenominatorComboBox->Append("8"); + mpDenominatorComboBox->Append("16"); + mpDenominatorComboBox->Append("32"); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(mpNumeratorComboBox, 0, wxALIGN_CENTER | wxALL, 6); + pTopSizer->Add(mpDenominatorComboBox, 0, wxALIGN_CENTER | wxALL, 6); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZMeterChangeDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Meterchange"); +} Property changes on: trunk/jazz/src/Dialogs/MeterChangeDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/MeterChangeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/MeterChangeDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/MeterChangeDialog.h 2010-04-26 02:08:50 UTC (rev 757) @@ -0,0 +1,49 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_METERCHANGEDIALOG_H +#define JZ_METERCHANGEDIALOG_H + +#include <wx/dialog.h> + +class wxComboBox; + +//***************************************************************************** +//***************************************************************************** +class JZMeterChangeDialog : public wxDialog +{ + public: + + JZMeterChangeDialog(wxWindow* pParent); + + private: + + void OnHelp(wxCommandEvent& Event); + + private: + + wxComboBox* mpNumeratorComboBox; + + wxComboBox* mpDenominatorComboBox; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_METERCHANGEDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/MeterChangeDialog.h ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/SetTempoDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SetTempoDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/SetTempoDialog.cpp 2010-04-26 02:08:50 UTC (rev 757) @@ -0,0 +1,143 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "SetTempoDialog.h" + +#include "../Events.h" +#include "../Globals.h" +#include "../Help.h" +#include "IntegerEdit.h" +#include "../Project.h" + +#include <wx/button.h> +#include <wx/sizer.h> +#include <wx/stattext.h> +#include <wx/textctrl.h> + +#include <string> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZSetTempoDialog, wxDialog) + +EVT_BUTTON(wxID_HELP, JZSetTempoDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZSetTempoDialog::JZSetTempoDialog( + tSetTempo* pSetTempoEvent, + JZTrack* pTrack, + wxWindow * pParent) + : wxDialog(pParent, wxID_ANY, wxString("Set Tempo (for track 0)")), + mpSetTempoEvent(pSetTempoEvent), + mpTempoEdit(0), + mpClockEdit(0) +{ + mpTempoEdit = new JZIntegerEdit(this, wxID_ANY); + mpTempoEdit->SetValueName("Tempo"); + mpTempoEdit->SetMinAndMax(20, 240); + + mpClockEdit = new wxTextCtrl(this, wxID_ANY); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + wxFlexGridSizer* pFlexGridSizer; + + pFlexGridSizer = new wxFlexGridSizer(2, 2, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Tempo:"), + 0, + wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpTempoEdit, + 0, + wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Clock:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add(mpClockEdit, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 10); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSetTempoDialog::TransferDataToWindow() +{ + mpTempoEdit->SetNumber(mpSetTempoEvent->GetBPM()); + + string ClockString; + gpProject->ClockToString(mpSetTempoEvent->GetClock(), ClockString); + mpClockEdit->ChangeValue(ClockString.c_str()); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSetTempoDialog::TransferDataFromWindow() +{ + int BeatsPerMinute; + if (mpTempoEdit->GetNumber(BeatsPerMinute)) + { + mpSetTempoEvent->SetBPM(BeatsPerMinute); + + wxString ClockString = mpClockEdit->GetValue(); + int Clock = gpProject->StringToClock(ClockString.c_str()); + mpSetTempoEvent->SetClock(Clock); + + return true; + } + return false; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSetTempoDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Set Tempo Dialog"); +} Property changes on: trunk/jazz/src/Dialogs/SetTempoDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/SetTempoDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SetTempoDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/SetTempoDialog.h 2010-04-26 02:08:50 UTC (rev 757) @@ -0,0 +1,61 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_SETTEMPODIALOG_H +#define JZ_SETTEMPODIALOG_H + +#include <wx/dialog.h> + +class JZIntegerEdit; +class JZTrack; +class tSetTempo; +class wxTextCtrl; + +//***************************************************************************** +//***************************************************************************** +class JZSetTempoDialog : public wxDialog +{ + public: + + JZSetTempoDialog( + tSetTempo* pSetTempoEvent, + JZTrack* pTrack, + wxWindow* pParent); + + private: + + bool TransferDataToWindow(); + + bool TransferDataFromWindow(); + + void OnHelp(wxCommandEvent& Event); + + private: + + tSetTempo* mpSetTempoEvent; + + JZIntegerEdit* mpTempoEdit; + + wxTextCtrl* mpClockEdit; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_SETTEMPODIALOG_H) Property changes on: trunk/jazz/src/Dialogs/SetTempoDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2010-04-25 23:59:43 UTC (rev 756) +++ trunk/jazz/src/Dialogs.cpp 2010-04-26 02:08:50 UTC (rev 757) @@ -28,6 +28,8 @@ #include "Dialogs/ControllerDialog.h" #include "Dialogs/KeyOnDialog.h" #include "Dialogs/ProgramChangeDialog.h" +#include "Dialogs/SetTempoDialog.h" +#include "Dialogs/SysexDialog.h" //#include "EventFrame.h" #include "Events.h" #include "EventWindow.h" @@ -112,7 +114,7 @@ //int tSearchReplaceDlg::toCtrl = 1; // //tSearchReplaceDlg::tSearchReplaceDlg(JZEventWindow* w, JZFilter *f) -// : tPropertyListDlg("Search and replace controller types" ) +// : tPropertyListDlg("Search and replace controller types") //{ // Filter = f; // Song = f->GetSong(); @@ -265,7 +267,7 @@ JZEvent *Event; JZEvent *Copy; - tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *t); + tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *pTrack); virtual void AddProperties(); virtual bool OnClose(); virtual void OnHelp(); @@ -273,12 +275,12 @@ }; -tEventDlg::tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *t) +tEventDlg::tEventDlg(JZEvent *e, JZPianoWindow* w, JZTrack *pTrack) : tPropertyListDlg( "Event" ), ClockDlg(w->GetProject(), "Time ", e->GetClock()) { Win = w; - Track = t; + Track = pTrack; Event = e; Copy = e->Copy(); } @@ -318,8 +320,8 @@ int Channel; - tChEventDlg(tChannelEvent* pChannelEvent, JZPianoWindow* w, JZTrack *t) - : tEventDlg(pChannelEvent, w, t) + tChEventDlg(tChannelEvent* pChannelEvent, JZPianoWindow* w, JZTrack *pTrack) + : tEventDlg(pChannelEvent, w, pTrack) { Channel = pChannelEvent->GetChannel() + 1; // 1..16 } @@ -353,15 +355,15 @@ int Value; - tPitchDlg(tPitch* e, JZPianoWindow* w, JZTrack *t); + tPitchDlg(tPitch* e, JZPianoWindow* w, JZTrack *pTrack); void AddProperties(); bool OnClose(); }; -tPitchDlg::tPitchDlg(tPitch *e, JZPianoWindow* w, JZTrack *t) - : tChEventDlg(e, w, t) +tPitchDlg::tPitchDlg(tPitch *e, JZPianoWindow* w, JZTrack *pTrack) + : tChEventDlg(e, w, pTrack) { Event = e; Value = e->Value; @@ -398,15 +400,15 @@ tNamedChoice Choice; - tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *t); + tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *pTrack); void AddProperties(); bool OnClose(); }; -tPlayTrackDlg::tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *t) - : tEventDlg(e, w, t), +tPlayTrackDlg::tPlayTrackDlg(tPlayTrack *e, JZPianoWindow* w, JZTrack *pTrack) + : tEventDlg(e, w, pTrack), Choice("playtrack", gpConfig->GetControlNames(), &track) { Event = e; @@ -457,15 +459,15 @@ int track; tNamedChoice Choice; - tTextDlg(tText *e, JZPianoWindow* w, JZTrack *t); + tTextDlg(tText *e, JZPianoWindow* w, JZTrack *pTrack); void AddProperties(); bool OnClose(); }; -tTextDlg::tTextDlg(tText *e, JZPianoWindow* w, JZTrack *t) - : tEventDlg(e, w, t), +tTextDlg::tTextDlg(tText *e, JZPianoWindow* w, JZTrack *pTrack) + : tEventDlg(e, w, pTrack), Choice("text", gpConfig->GetControlNames(), &track) { Event = e; @@ -504,15 +506,15 @@ tNamedChoice Choice; - tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *t); + tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *pTrack); void AddProperties(); bool OnClose(); }; -tEndOfTrackDlg::tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *t) - : tEventDlg(e, w, t), +tEndOfTrackDlg::tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *pTrack) + : tEventDlg(e, w, pTrack), Choice("End Of Track", gpConfig->GetControlNames(), &track) { @@ -532,211 +534,22 @@ } - -// -------------------------------- Set Tempo ------------------------------- - -class tSetTempoDlg : public tEventDlg +//***************************************************************************** +// Description: +// Display a dialog box to select an event to be created. +//***************************************************************************** +static JZEvent* CreateEventDialog(long Clock, int Channel, int Pitch) { - public: - - int Value; - - tSetTempoDlg(tSetTempo *e, JZPianoWindow* w, JZTrack *t); - - void AddProperties(); - bool OnClose(); -}; - - -tSetTempoDlg::tSetTempoDlg(tSetTempo *e, JZPianoWindow* w, JZTrack *t) - : tEventDlg(e, w, t) -{ - Event = e; - Value = e->GetBPM(); -} - - -bool tSetTempoDlg::OnClose() -{ - ((tSetTempo *)Copy)->SetBPM( Value ); - return tEventDlg::OnClose(); -} - -void tSetTempoDlg::AddProperties() -{ - // Add(wxMakeFormShort("Tempo:", &Value, wxFORM_DEFAULT, new wxList(wxMakeConstraintRange(20.0, 240.0), 0))); - sheet->AddProperty(new wxProperty( - "Tempo", - wxPropertyValue(&Value), - "integer", - new wxIntegerListValidator(20, 240))); - tEventDlg::AddProperties(); -} - -// -------------------------------- Sysex Edit------------------------------- - -class tSysexDlg : public tEventDlg -{ - public: - - char *str; - - tSysexDlg(tSysEx *s, JZPianoWindow* w, JZTrack *t); - - void AddProperties(); - bool OnClose(); -}; - - -tSysexDlg::tSysexDlg(tSysEx* pSysEx, JZPianoWindow* w, JZTrack *t) - : tEventDlg(pSysEx, w, t) -{ - Event = pSysEx; - char hexbyte[10]; - - str = new char[256]; - str[0] = 0; - - if (pSysEx->GetDataLength()) - { - strcat(str, "f0 "); - } - - const unsigned char* pData = pSysEx->GetData(); - for (int i = 0; i < pSysEx->GetDataLength(); i++) - { - sprintf(hexbyte, "%02x ", pData[i]); - strcat(str, hexbyte); - } -} - - -bool tSysexDlg::OnClose() -{ - int i; - int j; - int k; - int len; - - unsigned char d[256]; - memset( d, 0, 256 ); - - int jstop = strlen(str); - - unsigned int TempInteger; - for (i = 0, j = 0; j <= jstop; j += k, ++i) - { - sscanf(str + j, "%02x %n", &TempInteger, &k); - - d[i] = static_cast<unsigned char>(TempInteger); - if (d[i] == 0xf7) - break; - } - - int found = 0; - for (i = 0; i < 256; i++) - { - if (d[i] == 0xf7) - { - found = 1; - break; - } - } - - if (found) - len = i + 1; - else - len = 0; - - long clk = ((tSysEx *)Copy)->GetClock(); - delete Copy; - Copy = new tSysEx( clk, d + 1, len - 1 ); - - gpSynth->FixSysexCheckSum( Copy->IsSysEx() ); - -#if 0 - printf("Sysex:"); - for (i = 0; i < ((tSysEx *)Copy)->Length; i++) - { - printf( "%02x ", ((tSysEx *)Copy)->Data[i] ); - } - printf("\n"); - - gpMidiPlayer->OutNow( (tSysEx *)Copy ); -#endif - - delete str; - - tEventDlg::OnClose(); - return false; -} - -void tSysexDlg::AddProperties() -{ -// char label1[100]; - - if (Event->IsSysEx()->GetDataLength()) - { -// sprintf( -// label1, -// "Loaded sysex: %s", -// tSynthSysex::GetSysexName(gpSynth->GetSysexId(Event->IsSysEx()))); - -// Add(wxMakeFormMessage(label1)); - - sheet->AddProperty(new wxProperty( - "Loaded sysex", - wxPropertyValue(tSynthSysex::GetSysexName(gpSynth->GetSysexId( - Event->IsSysEx()))), - "string"));//r/o - - const unsigned char* pData = gpSynth->GetSysexValPtr(Event->IsSysEx()); - - if (pData) - { - ostringstream Oss; - Oss - << "First data byte is at offset " - << pData - Event->IsSysEx()->GetData() + 1 << ", value " - << setw(2) << hex << static_cast<int>(*pData) - << dec << " (" << static_cast<int>(*pData) << " decimal)"; - sheet->AddProperty(new wxProperty( - Oss.str().c_str(), - wxPropertyValue((char*)""), - "string"));//r/o -// Add(wxMakeFormMessage(Oss.str().c_str())); - } - } - else - { -// Add(wxMakeFormMessage("Example input: f0 7f 7f 04 01 00 7f f7")); - } - -// Add(wxMakeFormMessage("(any DT1/RQ1 checksums will be corrected)")); - -// Add(wxMakeFormString("SysEx (hex):", &str, wxFORM_DEFAULT, NULL, NULL, wxVERTICAL, 300 )); - sheet->AddProperty(new wxProperty("SysEx (hex)", wxPropertyValue((char**)&str), "string"));//r/o - - tEventDlg::AddProperties(); -} - - -// -------------------------------------------------------------------------- -// create new event -// -------------------------------------------------------------------------- - -static JZEvent *CreateEventDialog(long Clock, int Channel, int Pitch) -{ wxArrayString Names; Names.Add("Note On"); - Names.Add( "Controller"); - Names.Add( "Program Change"); - Names.Add( "Set Tempo"); - Names.Add( "SysEx"); - Names.Add( "Play Track(experimental)"); + Names.Add("Controller"); + Names.Add("Program Change"); + Names.Add("Set Tempo"); + Names.Add("SysEx"); + Names.Add("Play Track(experimental)"); Names.Add("End Of Track"); - Names.Add( "Text" ); + Names.Add("Text"); static long Values[] = { @@ -795,51 +608,56 @@ return e; } - - - +//***************************************************************************** +// Description: +// Display a dialog box to select an event to be created. +//***************************************************************************** void EventDialog( - JZEvent* e, + JZEvent* pEvent, JZPianoWindow* pPianoWindow, - JZTrack* t, + JZTrack* pTrack, long Clock, int Channel, int Pitch) { - if (!e) - e = CreateEventDialog(Clock, Channel, Pitch); - if (!e) + if (!pEvent) + { + pEvent = CreateEventDialog(Clock, Channel, Pitch); + } + + if (!pEvent) + { return; + } - tEventDlg *dlg = 0; + tEventDlg* pDialog = 0; const char* str = 0; - switch (e->GetStat()) + switch (pEvent->GetStat()) { case StatKeyOn: - if (t->GetAudioMode()) + if (pTrack->GetAudioMode()) { if (!gpMidiPlayer->IsPlaying()) { - gpMidiPlayer->EditSample(e->IsKeyOn()->GetKey()); + gpMidiPlayer->EditSample(pEvent->IsKeyOn()->GetKey()); } break; } - str = "Key On"; -// dlg = new tKeyOnDlg(e->IsKeyOn(), pPianoWindow, t); + +// pDialog = new tKeyOnDlg(pEvent->IsKeyOn(), pPianoWindow, pTrack); { - JZKeyOnDialog KeyOnDialog(e->IsKeyOn(), pPianoWindow); + JZKeyOnDialog KeyOnDialog(pEvent->IsKeyOn(), pPianoWindow); KeyOnDialog.ShowModal(); } break; case StatPitch: str = "Pitch Wheel"; - dlg = new tPitchDlg(e->IsPitch(), pPianoWindow, t); + pDialog = new tPitchDlg(pEvent->IsPitch(), pPianoWindow, pTrack); break; case StatControl: -// str = "Controller"; -// dlg = new tControlDlg(e->IsControl(), pPianoWindow, t); +// pDialog = new tControlDlg(pEvent->IsControl(), pPianoWindow, pTrack); { JZControllerDialog ControllerDialog(pPianoWindow); ControllerDialog.ShowModal(); @@ -847,8 +665,7 @@ break; case StatProgram: -// str = "Program Change"; -// dlg = new tProgramDlg(e->IsProgram(), pPianoWindow, t); +// pDialog = new tProgramDlg(pEvent->IsProgram(), pPianoWindow, pTrack); { JZProgramChangeDialog ProgramChangeDialog(pPianoWindow); ProgramChangeDialog.ShowModal(); @@ -856,88 +673,45 @@ break; case StatSetTempo: - str = "Set Tempo (for track 0)"; - dlg = new tSetTempoDlg( - e->IsSetTempo(), - pPianoWindow, - pPianoWindow->GetProject()->GetTrack(0)); + { + JZSetTempoDialog SetTempoDialog( + pEvent->IsSetTempo(), + pPianoWindow->GetProject()->GetTrack(0), + pPianoWindow); + SetTempoDialog.ShowModal(); + } break; case StatSysEx: - str = "System Exclusive"; - dlg = new tSysexDlg(e->IsSysEx(), pPianoWindow, t ); +// pDialog = new tSysexDlg(pEvent->IsSysEx(), pPianoWindow, pTrack); + { + JZSysexDialog SysexDialog(pEvent->IsSysEx(), pPianoWindow); + SysexDialog.ShowModal(); + } break; case StatPlayTrack: str = "Play Track"; - //dlg = new tPlayTrackDlg(e->IsPlayTrack(), pPianoWindow, t ); - dlg = new tPlayTrackDlg(e->IsPlayTrack(), pPianoWindow, t ); + pDialog = new tPlayTrackDlg(pEvent->IsPlayTrack(), pPianoWindow, pTrack); break; + case StatEndOfTrack: str = "End Of Track"; - dlg = new tEndOfTrackDlg(e->IsEndOfTrack(), pPianoWindow, t ); + pDialog = new tEndOfTrackDlg(pEvent->IsEndOfTrack(), pPianoWindow, pTrack); break; case StatText: str = "Text"; - dlg = new tTextDlg(e->IsText(), pPianoWindow, t ); + pDialog = new tTextDlg(pEvent->IsText(), pPianoWindow, pTrack); break; default: break; } - if (dlg) + + if (pDialog) { - dlg->Create(); + pDialog->Create(); } } - -//***************************************************************************** -// MeterChange Dialog -//***************************************************************************** - -int tMeterChangeDlg::Numerator = 4; -int tMeterChangeDlg::Denomiator = 4; -int tMeterChangeDlg::BarNr = 1; - -tMeterChangeDlg::tMeterChangeDlg(JZEventWindow* pEventWindow) - : tPropertyListDlg("Meter Change"), - mpEventWindow(pEventWindow) -{ -} - -void tMeterChangeDlg::AddProperties() -{ - sheet->AddProperty(new wxProperty( - "BarNr", - wxPropertyValue(&BarNr), - "integer"));//JAVE validators here? problem is i dont know which ranges are valid FIXME - sheet->AddProperty(new wxProperty( - "Numerator", - wxPropertyValue(&Numerator), - "integer")); - sheet->AddProperty(new wxProperty( - "Denomiator(2,4,8,16,32)", - wxPropertyValue(&Denomiator), - "integer"));//JAVE should be a integer list instead FIXME -} - -void tMeterChangeDlg::OnCancel() -{ - mpEventWindow->FinishMeterEdit(); -} - -bool tMeterChangeDlg::OnClose() -{ - BarNr += mpEventWindow->GetProject()->GetIntroLength(); - mpEventWindow->GetProject()->SetMeterChange(BarNr, Numerator, Denomiator); - mpEventWindow->Refresh(); - mpEventWindow->FinishMeterEdit(); - return false; -} - -void tMeterChangeDlg::OnHelp() -{ - gpHelpInstance->ShowTopic("Meterchange"); -} Modified: trunk/jazz/src/Dialogs.h =================================================================== --- trunk/jazz/src/Dialogs.h 2010-04-25 23:59:43 UTC (rev 756) +++ trunk/jazz/src/Dialogs.h 2010-04-26 02:08:50 UTC (rev 757) @@ -111,25 +111,4 @@ int Channel, int Pitch); -//***************************************************************************** -// MeterChange Dialog -//***************************************************************************** -class tMeterChangeDlg : public tPropertyListDlg -{ - public: - - tMeterChangeDlg(JZEventWindow* pEventWindow); - - void AddProperties(); - - virtual bool OnClose(); - virtual void OnCancel(); - virtual void OnHelp(); - - JZEventWindow* mpEventWindow; - static int Numerator; - static int Denomiator; - static int BarNr; -}; - #endif // !defined(JZ_DIALOGS_H) Modified: trunk/jazz/src/EventFrame.cpp =================================================================== --- trunk/jazz/src/EventFrame.cpp 2010-04-25 23:59:43 UTC (rev 756) +++ trunk/jazz/src/EventFrame.cpp 2010-04-26 02:08:50 UTC (rev 757) @@ -63,7 +63,8 @@ EVT_UPDATE_UI(ID_LENGTH, JZEventFrame::OnUpdateEventsSelected) EVT_MENU(ID_LENGTH, JZEventFrame::OnLength) - EVT_MENU(ID_METER_CHANGE, JZEventFrame::OnMeterChange) + EVT_MENU(ID_MISC_METER_CHANGE, JZEventFrame::OnMeterChange) + END_EVENT_TABLE() //----------------------------------------------------------------------------- Modified: trunk/jazz/src/EventWindow.cpp =================================================================== --- trunk/jazz/src/EventWindow.cpp 2010-04-25 23:59:43 UTC (rev 756) +++ trunk/jazz/src/EventWindow.cpp 2010-04-26 02:08:50 UTC (rev 757) @@ -26,6 +26,7 @@ #include "Dialogs/CleanupDialog.h" #include "Dialogs/DeleteDialog.h" #include "Dialogs/LengthDialog.h" +#include "Dialogs/MeterChangeDialog.h" #include "Dialogs/MidiChannelDialog.h" #include "Dialogs/QuantizeDialog.h" #include "Dialogs/SearchAndReplaceDialog.h" @@ -90,8 +91,7 @@ mFromLine(0), mToLine(0), mScrolledX(0), - mScrolledY(0), - mpSettingsDialog(0) + mScrolledY(0) { mpSnapSel = new JZSnapSelection(this); @@ -114,7 +114,6 @@ delete mpFilter; delete mpGreyColor; delete mpGreyBrush; - FinishMeterEdit(); } //----------------------------------------------------------------------------- @@ -346,47 +345,11 @@ //----------------------------------------------------------------------------- void JZEventWindow::EditMeter() { - if (!IsEditingMeter()) - { - if (!mpSettingsDialog) - { - mpSettingsDialog = new wxDialog(this, wxID_ANY, "Meter Change"); - } - mpSettingsDialog->Show(true); - } - else - { - mpSettingsDialog->SetFocus(); - } -// tMeterChangeDlg *dlg; -// dlg = new tMeterChangeDlg(this); -// dlg->Create(); + JZMeterChangeDialog MeterChangeDialog(this); + MeterChangeDialog.ShowModal(); } //----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZEventWindow::IsEditingMeter() const -{ - if (mpSettingsDialog) - { - return (mpSettingsDialog->GetHandle() != 0); - } - return false; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZEventWindow::FinishMeterEdit() -{ - if (mpSettingsDialog) - { - // Mark the dialog for destruction during idle time processing. - mpSettingsDialog->Destroy(); - mpSettingsDialog = 0; - } -} - -//----------------------------------------------------------------------------- // Description: // Only consider the event portion of the window when computing the virtual // size. Do not consider the static information of the left or top portion of Modified: trunk/jazz/src/EventWindow.h =================================================================== --- trunk/jazz/src/EventWindow.h 2010-04-25 23:59:43 UTC (rev 756) +++ trunk/jazz/src/EventWindow.h 2010-04-26 02:08:50 UTC (rev 757) @@ -76,8 +76,6 @@ void SearchReplace(); void EditMeter(); - bool IsEditingMeter() const; - void FinishMeterEdit(); void LineText( wxDC& Dc, @@ -148,9 +146,6 @@ int mScrolledX, mScrolledY; - // Settings-Dialog - wxDialog* mpSettingsDialog; - DECLARE_EVENT_TABLE() }; Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2010-04-25 23:59:43 UTC (rev 756) +++ trunk/jazz/src/Makefile.am 2010-04-26 02:08:50 UTC (rev 757) @@ -29,11 +29,13 @@ Dialogs/IntegerEdit.cpp \ Dialogs/LengthDialog.cpp \ Dialogs/KeyOnDialog.cpp \ +Dialogs/MeterChangeDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/MidiChannelDialog.cpp \ Dialogs/ProgramChangeDialog.cpp \ Dialogs/QuantizeDialog.cpp \ Dialogs/SearchAndReplaceDialog.cpp \ +Dialogs/SetTempoDialog.cpp \ Dialogs/ShiftDialog.cpp \ Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ @@ -120,11 +122,13 @@ Dialogs/IntegerEdit.cpp \ Dialogs/LengthDialog.cpp \ Dialogs/KeyOnDialog.cpp \ +Dialogs/MeterChangeDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/MidiChannelDialog.cpp \ Dialogs/ProgramChangeDialog.cpp \ Dialogs/QuantizeDialog.cpp \ Dialogs/SearchAndReplaceDialog.cpp \ +Dialogs/SetTempoDialog.cpp \ Dialogs/ShiftDialog.cpp \ Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ @@ -216,11 +220,13 @@ Dialogs/IntegerEdit.h \ Dialogs/LengthDialog.h \ Dialogs/KeyOnDialog.h \ +Dialogs/MeterChangeDialog.h \ Dialogs/MetronomeSettingsDialog.h \ Dialogs/MidiChannelDialog.h \ Dialogs/ProgramChangeDialog.h \ Dialogs/QuantizeDialog.h \ Dialogs/SearchAndReplaceDialog.h \ +Dialogs/SetTempoDialog.h \ Dialogs/ShiftDialog.h \ Dialogs/SnapDialog.h \ Dialogs/SynthesizerSettingsDialog.h \ Modified: trunk/jazz/src/PianoFrame.cpp =================================================================== --- trunk/jazz/src/PianoFrame.cpp 2010-04-25 23:59:43 UTC (rev 756) +++ trunk/jazz/src/PianoFrame.cpp 2010-04-26 02:08:50 UTC (rev 757) @@ -69,7 +69,6 @@ #define MEN_GUITAR 29 -#define MEN_RESET 36 #define MEN_VIS_ALL_TRK 37 #define ACT_CLOSE 41 @@ -108,8 +107,8 @@ { wxID_ZOOM_OUT, FALSE, zoomout_xpm, "zoom out"}, { wxID_UNDO, FALSE, undo_xpm, "undo"}, { MEN_REDO, FALSE, redo_xpm, "redo"}, - { MEN_RESET, FALSE, panic_xpm, "all notes off"}, - { ID_HELP_PIANO_WINDOW, FALSE, help_xpm, "help"}, + { ID_MISC_RESET_MIDI, FALSE, panic_xpm, "all notes off"}, + { ID_HELP_PIANO_WINDOW, FALSE, help_xpm, "help"}, { JZToolBar::eToolBarEnd } }; */ @@ -156,7 +155,7 @@ EVT_MENU(ID_CUT_PASTE_EVENTS, JZPianoFrame::OnMCutPaste) EVT_MENU(MEN_GUITAR, JZPianoFrame::OnGuitar) - EVT_MENU(MEN_RESET, JZPianoFrame::OnReset) + EVT_MENU(ID_MISC_RESET_MIDI, JZPianoFrame::OnReset) EVT_MENU(MEN_VIS_ALL_TRK, JZPianoFrame::OnVisibleAllTracks) EVT_MENU(wxID_DELETE, JZPianoFrame::OnErase) EVT_MENU(wxID_CUT, JZPianoFrame::OnCut) @@ -339,11 +338,11 @@ edit_menu->Append(ID_SEARCH_AND_REPLACE, "&Search Replace..."); wxMenu *setting_menu = new wxMenu("", wxMENU_TEAROFF); - setting_menu->Append(MEN_FILTER, "&Filter..."); - setting_menu->Append(ACT_SETTINGS, "&Window..."); - setting_menu->Append(MEN_VISIBLE, "&Events..."); - setting_menu->Append(ID_SNAP, "&Snap..."); - setting_menu->Append(ID_METER_CHANGE, "&Meter Change..."); + setting_menu->Append(MEN_FILTER, "&Filter..."); + setting_menu->Append(ACT_SETTINGS, "&Window..."); + setting_menu->Append(MEN_VISIBLE, "&Events..."); + setting_menu->Append(ID_SNAP, "&Snap..."); + setting_menu->Append(ID_MISC_METER_CHANGE, "&Meter Change..."); wxMenu *misc_menu = new wxMenu("",wxMENU_TEAROFF); misc_menu->Append(wxID_UNDO, "&Undo"); @@ -498,18 +497,6 @@ gpMidiPlayer->AllNotesOff(1); } -//INSER_EVENT_HANDLER_HERE - -/* - -//these wont compile nicely - -case MEN_VISIBLE: VisibleDialog(); break; - -case ID_METER_CHANGE: OnMeterChange(); break; - -*/ - void JZPianoFrame::OnMSelect(wxCommandEvent& Event) { mpPianoWindow->MSelect(); Modified: trunk/jazz/src/Resources.h =================================================================== --- trunk/jazz/src/Resources.h 2010-04-25 23:59:43 UTC (rev 756) +++ trunk/jazz/src/Resources.h 2010-04-26 02:08:50 UTC (rev 757) @@ -60,16 +60,20 @@ #define ID_METRONOME_TOGGLE wxID_HIGHEST + 43 #define ID_VELOCITY wxID_HIGHEST + 44 #define ID_LENGTH wxID_HIGHEST + 45 -#define ID_METER_CHANGE wxID_HIGHEST + 46 -#define ID_TRANSPOSE wxID_HIGHEST + 47 -#define ID_CLEANUP wxID_HIGHEST + 48 -#define ID_SEARCH_AND_REPLACE wxID_HIGHEST + 49 +#define ID_MISC_TRACK_MERGE wxID_HIGHEST + 46 +#define ID_MISC_SPLIT_TRACKS wxID_HIGHEST + 47 +#define ID_MISC_METER_CHANGE wxID_HIGHEST + 48 +#define ID_MISC_RESET_MIDI wxID_HIGHEST + 49 +#define ID_MISC_SET_COPYRIGHT wxID_HIGHEST + 50 +#define ID_TRANSPOSE wxID_HIGHEST + 51 +#define ID_CLEANUP wxID_HIGHEST + 52 +#define ID_SEARCH_AND_REPLACE wxID_HIGHEST + 53 -#define ID_PLAY wxID_HIGHEST + 50 -#define ID_PLAY_LOOP wxID_HIGHEST + 51 -#define ID_RECORD wxID_HIGHEST + 52 +#define ID_PLAY wxID_HIGHEST + 60 +#define ID_PLAY_LOOP wxID_HIGHEST + 61 +#define ID_RECORD wxID_HIGHEST + 62 -#define ID_SELECT wxID_HIGHEST + 60 +#define ID_SELECT wxID_HIGHEST + 65 #define ID_CHANGE_LENGTH wxID_HIGHEST + 70 Modified: trunk/jazz/src/TrackFrame.cpp =================================================================== --- trunk/jazz/src/TrackFrame.cpp 2010-04-25 23:59:43 UTC (rev 756) +++ trunk/jazz/src/TrackFrame.cpp 2010-04-26 02:08:50 UTC (rev 757) @@ -267,24 +267,22 @@ mpEditMenu->Append(MEN_SELECTIONSUB, "Select (needs submenu)"); mpEditMenu->AppendSeparator(); +#endif - - // Miscellaneous Menu is Stupid. - // Now it's a View Menu - misc_menu = new wxMenu; - misc_menu->Append(MEN_TMERGE, "Mer&ge Tracks..."); - misc_menu->Append(MEN_TSPLIT, "&Split Tracks..."); - misc_menu->Append(ID_METER_CHANGE, "&Meter Change..."); - misc_menu->Append(MEN_RESET, "&Reset Midi"); - misc_menu->Append(MEN_HARMONY, "&Harmony Browser..."); - misc_menu->Append(MEN_RHYTHM, "Random R&hythm..."); - misc_menu->Append(MEN_SHUFFLE, "Random Sh&uffle..."); - misc_menu->Append(MEN_GENMELDY, "Random Melod&y..."); - misc_menu->Append(MEN_ARPEGGIO, "Random Arpeggio..."); - misc_menu->Append(MEN_MAPPER, "Ma&pper..."); - misc_menu->Append(MEN_EVENTLIST, "Event &List..."); - misc_menu->Append(MEN_COPYRIGHT, "&Set Music Copyright..."); + wxMenu* pMiscMenu = new wxMenu; + pMiscMenu->Append(ID_MISC_TRACK_MERGE, "Mer&ge Tracks..."); + pMiscMenu->Append(ID_MISC_SPLIT_TRACKS, "&Split Tracks..."); + pMiscMenu->Append(ID_MISC_METER_CHANGE, "&Meter Change..."); + pMiscMenu->Append(ID_MISC_RESET_MIDI, "&Reset Midi"); +#if 0 + pMiscMenu->Append(MEN_RHYTHM, "Random R&hythm..."); + pMiscMenu->Append(MEN_SHUFFLE, "Random Sh&uffle..."); + pMiscMenu->Append(MEN_GENMELDY, "Random Melod&y..."); + pMiscMenu->Append(MEN_ARPEGGIO, "Random Arpeggio..."); + pMiscMenu->Append(MEN_MAPPER, "Ma&pper..."); + pMiscMenu->Append(MEN_EVENTLIST, "Event &List..."); #endif + pMiscMenu->Append(ID_MISC_SET_COPYRIGHT, "&Set Music Copyright..."); mpToolsMenu = new wxMenu; mpToolsMenu->Append(ID_TOOLS_HARMONY_BROWSER, "&Harmony Browser..."); @@ -393,14 +391,12 @@ wxMenuBar* pMenuBar = new wxMenuBar(); pMenuBar->Append(mpFileMenu, "&File"); pMenuBar->Append(mpEditMenu, "&Edit"); - pMenuBar->Append(mpToolsMenu, "&Tools"); - #if 0 - pMenuBar->Append(misc_menu, "&View"); pMenuBar->Append(parts_menu, "&Parts"); #endif - + pMenuBar->Append(mpToolsMenu, "&Tools"); pMenuBar->Append(pSettingMenu, "&Settings"); + pMenuBar->Append(pMiscMenu, "&Misc"); wxMenu* pAudioMenu = new wxMenu; pAudioMenu->Append(ID_AUDIO_GLOBAL_SETTINGS, "&Global Settings..."); Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-25 23:59:43 UTC (rev 756) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-26 02:08:50 UTC (rev 757) @@ -903,6 +903,14 @@ > </File> <File + RelativePath="..\src\Dialogs\MeterChangeDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\MeterChangeDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\MetronomeSettingsDialog.cpp" > </File> @@ -943,6 +951,14 @@ > </File> <File + RelativePath="..\src\Dialogs\SetTempoDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\SetTempoDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\ShiftDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-26 03:44:29
|
Revision: 758 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=758&view=rev Author: pstieber Date: 2010-04-26 03:44:22 +0000 (Mon, 26 Apr 2010) Log Message: ----------- 1. Added new text and end of track dialogs. 2. Added SetText for the text event. 3. Added a track pointer to the SysEx dialog. 4. Added arguments to the program changed and controller dialogs. Modified Paths: -------------- trunk/jazz/src/Dialogs/ControllerDialog.cpp trunk/jazz/src/Dialogs/ControllerDialog.h trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp trunk/jazz/src/Dialogs/ProgramChangeDialog.h trunk/jazz/src/Dialogs/SysexDialog.cpp trunk/jazz/src/Dialogs/SysexDialog.h trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Events.h trunk/jazz/src/Makefile.am trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp trunk/jazz/src/Dialogs/EndOfTrackDialog.h trunk/jazz/src/Dialogs/TextDialog.cpp trunk/jazz/src/Dialogs/TextDialog.h Modified: trunk/jazz/src/Dialogs/ControllerDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/ControllerDialog.cpp 2010-04-26 02:08:50 UTC (rev 757) +++ trunk/jazz/src/Dialogs/ControllerDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) @@ -1,3 +1,23 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + #include "ControllerDialog.h" #include "../Configuration.h" @@ -18,8 +38,12 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -JZControllerDialog::JZControllerDialog(wxWindow* pParent) +JZControllerDialog::JZControllerDialog( + tControl* pControl, + JZTrack* pTrack, + wxWindow* pParent) : wxDialog(pParent, wxID_ANY, wxString("Controller")), + mpControl(pControl), mpControllerListBox(0) { mpControllerListBox = new wxListBox(this, wxID_ANY); Modified: trunk/jazz/src/Dialogs/ControllerDialog.h =================================================================== --- trunk/jazz/src/Dialogs/ControllerDialog.h 2010-04-26 02:08:50 UTC (rev 757) +++ trunk/jazz/src/Dialogs/ControllerDialog.h 2010-04-26 03:44:22 UTC (rev 758) @@ -24,6 +24,8 @@ #include <wx/dialog.h> +class tControl; +class JZTrack; class wxListBox; //***************************************************************************** @@ -32,10 +34,15 @@ { public: - JZControllerDialog(wxWindow* pParent); + JZControllerDialog( + tControl* pControl, + JZTrack* pTrack, + wxWindow* pParent); private: + tControl* mpControl; + wxListBox* mpControllerListBox; DECLARE_EVENT_TABLE(); Added: trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) @@ -0,0 +1,118 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "EndOfTrackDialog.h" + +#include "../Globals.h" +#include "../Help.h" +#include "../Project.h" + +#include <wx/button.h> +#include <wx/sizer.h> +#include <wx/stattext.h> +#include <wx/textctrl.h> + +#include <string> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZEndOfTrackDialog, wxDialog) + + EVT_BUTTON(wxID_HELP, JZEndOfTrackDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZEndOfTrackDialog::JZEndOfTrackDialog( + tEndOfTrack* pEndOfTrackEvent, + JZTrack* pTrack, + wxWindow * pParent) + : wxDialog(pParent, wxID_ANY, wxString("End of Track")), + mpEndOfTrackEvent(pEndOfTrackEvent), + mpClockEdit(0) +{ + mpClockEdit = new wxTextCtrl(this, wxID_ANY); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + wxFlexGridSizer* pFlexGridSizer; + + pFlexGridSizer = new wxFlexGridSizer(1, 2, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Time:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add(mpClockEdit, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZEndOfTrackDialog::TransferDataToWindow() +{ + string ClockString; + gpProject->ClockToString(mpEndOfTrackEvent->GetClock(), ClockString); + mpClockEdit->ChangeValue(ClockString.c_str()); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZEndOfTrackDialog::TransferDataFromWindow() +{ + wxString ClockString = mpClockEdit->GetValue(); + int Clock = gpProject->StringToClock(ClockString.c_str()); + mpEndOfTrackEvent->SetClock(Clock); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZEndOfTrackDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Template"); +} Property changes on: trunk/jazz/src/Dialogs/EndOfTrackDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/EndOfTrackDialog.h =================================================================== --- trunk/jazz/src/Dialogs/EndOfTrackDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/EndOfTrackDialog.h 2010-04-26 03:44:22 UTC (rev 758) @@ -0,0 +1,58 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_ENDOFTRACKDIALOG_H +#define JZ_ENDOFTRACKDIALOG_H + +#include <wx/dialog.h> + +class tEndOfTrack; +class JZTrack; +class wxTextCtrl; + +//***************************************************************************** +//***************************************************************************** +class JZEndOfTrackDialog : public wxDialog +{ + public: + + JZEndOfTrackDialog( + tEndOfTrack* pEndOfTrackEvent, + JZTrack* pTrack, + wxWindow* pParent); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnHelp(wxCommandEvent& Event); + + private: + + tEndOfTrack* mpEndOfTrackEvent; + + wxTextCtrl* mpClockEdit; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_ENDOFTRACKDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/EndOfTrackDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp 2010-04-26 02:08:50 UTC (rev 757) +++ trunk/jazz/src/Dialogs/ProgramChangeDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) @@ -1,3 +1,23 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + #include "ProgramChangeDialog.h" #include "../Configuration.h" @@ -18,8 +38,12 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -JZProgramChangeDialog::JZProgramChangeDialog(wxWindow* pParent) +JZProgramChangeDialog::JZProgramChangeDialog( + tProgram* pProgram, + JZTrack* pTrack, + wxWindow* pParent) : wxDialog(pParent, wxID_ANY, wxString("Program Change")), + mpProgram(pProgram), mpProgramListBox(0) { mpProgramListBox = new wxListBox(this, wxID_ANY); Modified: trunk/jazz/src/Dialogs/ProgramChangeDialog.h =================================================================== --- trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2010-04-26 02:08:50 UTC (rev 757) +++ trunk/jazz/src/Dialogs/ProgramChangeDialog.h 2010-04-26 03:44:22 UTC (rev 758) @@ -23,6 +23,8 @@ #include <wx/dialog.h> +class tProgram; +class JZTrack; class wxListBox; //***************************************************************************** @@ -31,10 +33,15 @@ { public: - JZProgramChangeDialog(wxWindow* pParent); + JZProgramChangeDialog( + tProgram* pProgram, + JZTrack* pTrack, + wxWindow* pParent); private: + tProgram* mpProgram; + wxListBox* mpProgramListBox; DECLARE_EVENT_TABLE(); Modified: trunk/jazz/src/Dialogs/SysexDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-04-26 02:08:50 UTC (rev 757) +++ trunk/jazz/src/Dialogs/SysexDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) @@ -47,7 +47,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -JZSysexDialog::JZSysexDialog(tSysEx* pEvent, wxWindow* pParent) +JZSysexDialog::JZSysexDialog( + tSysEx* pEvent, + JZTrack* pTrack, + wxWindow* pParent) : wxDialog(pParent, wxID_ANY, wxString("System Exclusive")), mpSysExEvent(pEvent), mpSysExEdit(0), Modified: trunk/jazz/src/Dialogs/SysexDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SysexDialog.h 2010-04-26 02:08:50 UTC (rev 757) +++ trunk/jazz/src/Dialogs/SysexDialog.h 2010-04-26 03:44:22 UTC (rev 758) @@ -26,6 +26,7 @@ class JZKnob; class JZKnobEvent; class tSysEx; +class JZTrack; class wxStaticText; class wxTextCtrl; @@ -35,7 +36,7 @@ { public: - JZSysexDialog(tSysEx* pEvent, wxWindow* pParent); + JZSysexDialog(tSysEx* pEvent, JZTrack* pTrack, wxWindow* pParent); private: Added: trunk/jazz/src/Dialogs/TextDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/TextDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/TextDialog.cpp 2010-04-26 03:44:22 UTC (rev 758) @@ -0,0 +1,134 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "TextDialog.h" + +#include "../Events.h" +#include "../Globals.h" +#include "../Help.h" +#include "../Project.h" + +#include <wx/button.h> +#include <wx/sizer.h> +#include <wx/stattext.h> +#include <wx/textctrl.h> + +#include <string> + +using namespace std; + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZTextDialog, wxDialog) + + EVT_BUTTON(wxID_HELP, JZTextDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZTextDialog::JZTextDialog( + tText* pTextEvent, + JZTrack* pTrack, + wxWindow * pParent) + : wxDialog(pParent, wxID_ANY, wxString("Text")), + mpTextEvent(pTextEvent), + mpTextEdit(0), + mpClockEdit(0) +{ + mpTextEdit = new wxTextCtrl(this, wxID_ANY); + mpClockEdit = new wxTextCtrl(this, wxID_ANY); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + wxFlexGridSizer* pFlexGridSizer; + + pFlexGridSizer = new wxFlexGridSizer(2, 2, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Text:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add(mpTextEdit, 0, wxALIGN_CENTER_VERTICAL); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Time:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add(mpClockEdit, 0, wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxCENTER | wxALL, 2); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZTextDialog::TransferDataToWindow() +{ + const unsigned char* pText = mpTextEvent->GetData(); + + mpTextEdit->ChangeValue(pText); + + string ClockString; + gpProject->ClockToString(mpTextEvent->GetClock(), ClockString); + mpClockEdit->ChangeValue(ClockString.c_str()); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZTextDialog::TransferDataFromWindow() +{ + wxString Text = mpTextEdit->GetValue(); + mpTextEvent->SetText(Text.c_str()); + + wxString ClockString = mpClockEdit->GetValue(); + int Clock = gpProject->StringToClock(ClockString.c_str()); + mpTextEvent->SetClock(Clock); + + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZTextDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Text Dialog"); +} Property changes on: trunk/jazz/src/Dialogs/TextDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/TextDialog.h =================================================================== --- trunk/jazz/src/Dialogs/TextDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/TextDialog.h 2010-04-26 03:44:22 UTC (rev 758) @@ -0,0 +1,56 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_TEXTDIALOG_H +#define JZ_TEXTDIALOG_H + +#include <wx/dialog.h> + +class JZTrack; +class tText; +class wxTextCtrl; + +//***************************************************************************** +//***************************************************************************** +class JZTextDialog : public wxDialog +{ + public: + + JZTextDialog(tText* pTextEvent, JZTrack* pTrack, wxWindow* pParent); + + private: + + bool TransferDataToWindow(); + + bool TransferDataFromWindow(); + + void OnHelp(wxCommandEvent& Event); + + private: + + tText* mpTextEvent; + + wxTextCtrl* mpTextEdit; + wxTextCtrl* mpClockEdit; + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_TEXTDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/TextDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2010-04-26 02:08:50 UTC (rev 757) +++ trunk/jazz/src/Dialogs.cpp 2010-04-26 03:44:22 UTC (rev 758) @@ -26,11 +26,12 @@ #include "Command.h" #include "DeprecatedWx/proplist.h" #include "Dialogs/ControllerDialog.h" +#include "Dialogs/EndOfTrackDialog.h" #include "Dialogs/KeyOnDialog.h" #include "Dialogs/ProgramChangeDialog.h" #include "Dialogs/SetTempoDialog.h" #include "Dialogs/SysexDialog.h" -//#include "EventFrame.h" +#include "Dialogs/TextDialog.h" #include "Events.h" #include "EventWindow.h" #include "Filter.h" @@ -425,7 +426,7 @@ Choice.GetValue(); p->track = track; p->transpose = transpose; - p->eventlength=eventlength; + p->eventlength = eventlength; return tEventDlg::OnClose(); } @@ -449,91 +450,7 @@ tEventDlg::AddProperties(); } -// -------------------------------- text event --------------------------- -class tTextDlg : public tEventDlg -{ - public: - - char* text; - int track; - tNamedChoice Choice; - - tTextDlg(tText *e, JZPianoWindow* w, JZTrack *pTrack); - - void AddProperties(); - bool OnClose(); -}; - - -tTextDlg::tTextDlg(tText *e, JZPianoWindow* w, JZTrack *pTrack) - : tEventDlg(e, w, pTrack), - Choice("text", gpConfig->GetControlNames(), &track) -{ - Event = e; - text=new char[2048]; - strcpy(text, (const char*)(e->GetText())); -} - - -bool tTextDlg::OnClose() -{ - tText* p; - p=new tText( ((tText*)Copy)->GetClock(), (unsigned char*)text, strlen(text)); - delete Copy; - Copy=p; - fprintf(stderr,"text:%s",text); - Choice.GetValue(); - delete text; - return tEventDlg::OnClose(); -} - -void tTextDlg::AddProperties() -{ - sheet->AddProperty(new wxProperty("Text", wxPropertyValue((char**)&text), "string")); - // Add(wxMakeFormString("Text:", (char**)&text)); - tEventDlg::AddProperties(); -} - - - -// -------------------------------- EOT --------------------------- - -class tEndOfTrackDlg : public tEventDlg -{ - public: - int track; - - tNamedChoice Choice; - - tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *pTrack); - - void AddProperties(); - bool OnClose(); -}; - - -tEndOfTrackDlg::tEndOfTrackDlg(tEndOfTrack *e, JZPianoWindow* w, JZTrack *pTrack) - : tEventDlg(e, w, pTrack), - Choice("End Of Track", gpConfig->GetControlNames(), &track) -{ - -} - - -bool tEndOfTrackDlg::OnClose() -{ -// tEndOfTrack* p=(tEndOfTrack*)Copy; - Choice.GetValue(); - return tEventDlg::OnClose(); -} - -void tEndOfTrackDlg::AddProperties() -{ - tEventDlg::AddProperties(); -} - - //***************************************************************************** // Description: // Display a dialog box to select an event to be created. @@ -657,17 +574,21 @@ break; case StatControl: -// pDialog = new tControlDlg(pEvent->IsControl(), pPianoWindow, pTrack); { - JZControllerDialog ControllerDialog(pPianoWindow); + JZControllerDialog ControllerDialog( + pEvent->IsControl(), + pTrack, + pPianoWindow); ControllerDialog.ShowModal(); } break; case StatProgram: -// pDialog = new tProgramDlg(pEvent->IsProgram(), pPianoWindow, pTrack); { - JZProgramChangeDialog ProgramChangeDialog(pPianoWindow); + JZProgramChangeDialog ProgramChangeDialog( + pEvent->IsProgram(), + pTrack, + pPianoWindow); ProgramChangeDialog.ShowModal(); } break; @@ -683,9 +604,8 @@ break; case StatSysEx: -// pDialog = new tSysexDlg(pEvent->IsSysEx(), pPianoWindow, pTrack); { - JZSysexDialog SysexDialog(pEvent->IsSysEx(), pPianoWindow); + JZSysexDialog SysexDialog(pEvent->IsSysEx(), pTrack, pPianoWindow); SysexDialog.ShowModal(); } break; @@ -696,16 +616,22 @@ break; case StatEndOfTrack: - str = "End Of Track"; - pDialog = new tEndOfTrackDlg(pEvent->IsEndOfTrack(), pPianoWindow, pTrack); + { + JZEndOfTrackDialog EndOfTrackDialog( + pEvent->IsEndOfTrack(), + pTrack, + pPianoWindow); + EndOfTrackDialog.ShowModal(); + } break; case StatText: - str = "Text"; - pDialog = new tTextDlg(pEvent->IsText(), pPianoWindow, pTrack); + { + JZTextDialog SysexDialog(pEvent->IsText(), pTrack, pPianoWindow); + SysexDialog.ShowModal(); + } break; - default: break; } Modified: trunk/jazz/src/Events.h =================================================================== --- trunk/jazz/src/Events.h 2010-04-26 02:08:50 UTC (rev 757) +++ trunk/jazz/src/Events.h 2010-04-26 03:44:22 UTC (rev 758) @@ -1317,6 +1317,16 @@ { return mpData; } + + void SetText(const char* pText) + { + if (pText && strlen(pText) > 0) + { + delete [] mpData; + mpData = new unsigned char[strlen(pText)]; + memcpy(mpData, pText, strlen(pText)); + } + } }; //***************************************************************************** Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2010-04-26 02:08:50 UTC (rev 757) +++ trunk/jazz/src/Makefile.am 2010-04-26 03:44:22 UTC (rev 758) @@ -25,6 +25,7 @@ Dialogs/CleanupDialog.cpp \ Dialogs/ControllerDialog.cpp \ Dialogs/DeleteDialog.cpp \ +Dialogs/EndOfTrackDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ Dialogs/LengthDialog.cpp \ @@ -40,6 +41,7 @@ Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/SysexDialog.cpp \ +Dialogs/TextDialog.cpp \ Dialogs/TrackDialog.cpp \ Dialogs/TransposeDialog.cpp \ Dialogs/VelocityDialog.cpp \ @@ -118,6 +120,7 @@ Dialogs/CleanupDialog.cpp \ Dialogs/ControllerDialog.cpp \ Dialogs/DeleteDialog.cpp \ +Dialogs/EndOfTrackDialog.cpp \ Dialogs/FilterDialog.cpp \ Dialogs/IntegerEdit.cpp \ Dialogs/LengthDialog.cpp \ @@ -133,6 +136,7 @@ Dialogs/SnapDialog.cpp \ Dialogs/SynthesizerSettingsDialog.cpp \ Dialogs/SysexDialog.cpp \ +Dialogs/TextDialog.cpp \ Dialogs/TrackDialog.cpp \ Dialogs/TransposeDialog.cpp \ Dialogs/VelocityDialog.cpp \ @@ -216,6 +220,7 @@ Dialogs/CleanupDialog.h \ Dialogs/ControllerDialog.h \ Dialogs/DeleteDialog.h \ +Dialogs/EndOfTrackDialog.h \ Dialogs/FilterDialog.h \ Dialogs/IntegerEdit.h \ Dialogs/LengthDialog.h \ @@ -231,6 +236,7 @@ Dialogs/SnapDialog.h \ Dialogs/SynthesizerSettingsDialog.h \ Dialogs/SysexDialog.h \ +Dialogs/TextDialog.h \ Dialogs/TrackDialog.h \ Dialogs/TransposeDialog.h \ Dialogs/VelocityDialog.h \ Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-26 02:08:50 UTC (rev 757) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-26 03:44:22 UTC (rev 758) @@ -871,6 +871,14 @@ > </File> <File + RelativePath="..\src\Dialogs\EndOfTrackDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\EndOfTrackDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\FilterDialog.cpp" > </File> @@ -991,6 +999,14 @@ > </File> <File + RelativePath="..\src\Dialogs\TextDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\TextDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\TrackDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-04-27 03:39:43
|
Revision: 764 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=764&view=rev Author: pstieber Date: 2010-04-27 03:39:37 +0000 (Tue, 27 Apr 2010) Log Message: ----------- 1. Added a track pointer to the key on dialog constructor argument list. 2. Replaced the old pitch wheel dialog with a new empty version. 3. Simplified logic in JZSysExEvent::GetPitch(). Modified Paths: -------------- trunk/jazz/src/Dialogs/KeyOnDialog.cpp trunk/jazz/src/Dialogs/KeyOnDialog.h trunk/jazz/src/Dialogs.cpp trunk/jazz/src/Events.cpp trunk/jazz/src/Makefile.am trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/PitchWheelDialog.cpp trunk/jazz/src/Dialogs/PitchWheelDialog.h Modified: trunk/jazz/src/Dialogs/KeyOnDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2010-04-27 03:37:28 UTC (rev 763) +++ trunk/jazz/src/Dialogs/KeyOnDialog.cpp 2010-04-27 03:39:37 UTC (rev 764) @@ -54,7 +54,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -JZKeyOnDialog::JZKeyOnDialog(JZKeyOnEvent* pEvent, wxWindow* pParent) +JZKeyOnDialog::JZKeyOnDialog( + JZKeyOnEvent* pEvent, + JZTrack* pTrack, + wxWindow* pParent) : wxDialog(pParent, wxID_ANY, wxString("Key On")), mpEvent(pEvent), mpPitchEdit(0), Modified: trunk/jazz/src/Dialogs/KeyOnDialog.h =================================================================== --- trunk/jazz/src/Dialogs/KeyOnDialog.h 2010-04-27 03:37:28 UTC (rev 763) +++ trunk/jazz/src/Dialogs/KeyOnDialog.h 2010-04-27 03:39:37 UTC (rev 764) @@ -26,6 +26,7 @@ class JZKnob; class JZKnobEvent; class JZKeyOnEvent; +class JZTrack; class wxStaticText; class wxTextCtrl; @@ -35,7 +36,7 @@ { public: - JZKeyOnDialog(JZKeyOnEvent* pEvent, wxWindow* pParent); + JZKeyOnDialog(JZKeyOnEvent* pEvent, JZTrack* pTrack, wxWindow* pParent); private: Added: trunk/jazz/src/Dialogs/PitchWheelDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/PitchWheelDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/PitchWheelDialog.cpp 2010-04-27 03:39:37 UTC (rev 764) @@ -0,0 +1,87 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "PitchWheelDialog.h" + +#include "../Globals.h" +#include "../Help.h" + +#include <wx/button.h> +#include <wx/sizer.h> + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +BEGIN_EVENT_TABLE(JZPitchWheelDialog, wxDialog) + + EVT_BUTTON(wxID_HELP, JZPitchWheelDialog::OnHelp) + +END_EVENT_TABLE() + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZPitchWheelDialog::JZPitchWheelDialog( + JZPitchEvent* pPitchEvent, + JZTrack* pTrack, + wxWindow * pParent) + : wxDialog(pParent, wxID_ANY, wxString("Pitch Wheel")) +{ + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZPitchWheelDialog::TransferDataToWindow() +{ + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZPitchWheelDialog::TransferDataFromWindow() +{ + return true; +} + +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZPitchWheelDialog::OnHelp(wxCommandEvent& Event) +{ + gpHelpInstance->ShowTopic("Pitch Wheel Dialog"); +} Property changes on: trunk/jazz/src/Dialogs/PitchWheelDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/PitchWheelDialog.h =================================================================== --- trunk/jazz/src/Dialogs/PitchWheelDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/PitchWheelDialog.h 2010-04-27 03:39:37 UTC (rev 764) @@ -0,0 +1,53 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_PITCHWHEELDIALOG_H +#define JZ_PITCHWHEELDIALOG_H + +class JZPitchEvent; +class JZTrack; + +#include <wx/dialog.h> + +//***************************************************************************** +//***************************************************************************** +class JZPitchWheelDialog : public wxDialog +{ + public: + + JZPitchWheelDialog( + JZPitchEvent* pPitchEvent, + JZTrack* pTrack, + wxWindow* pParent); + + private: + + virtual bool TransferDataToWindow(); + + virtual bool TransferDataFromWindow(); + + void OnHelp(wxCommandEvent& Event); + + private: + + DECLARE_EVENT_TABLE(); +}; + +#endif // !defined(JZ_PITCHWHEELDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/PitchWheelDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Dialogs.cpp =================================================================== --- trunk/jazz/src/Dialogs.cpp 2010-04-27 03:37:28 UTC (rev 763) +++ trunk/jazz/src/Dialogs.cpp 2010-04-27 03:39:37 UTC (rev 764) @@ -28,6 +28,7 @@ #include "Dialogs/ControllerDialog.h" #include "Dialogs/EndOfTrackDialog.h" #include "Dialogs/KeyOnDialog.h" +#include "Dialogs/PitchWheelDialog.h" #include "Dialogs/ProgramChangeDialog.h" #include "Dialogs/SetTempoDialog.h" #include "Dialogs/SysexDialog.h" @@ -348,46 +349,6 @@ return false; } -// -------------------------------- Pitch ------------------------------- - -class tPitchDlg : public tChEventDlg -{ - public: - - int Value; - - tPitchDlg(JZPitchEvent* e, JZPianoWindow* w, JZTrack *pTrack); - - void AddProperties(); - bool OnClose(); -}; - - -tPitchDlg::tPitchDlg(JZPitchEvent *e, JZPianoWindow* w, JZTrack *pTrack) - : tChEventDlg(e, w, pTrack) -{ - Event = e; - Value = e->Value; -} - - -bool tPitchDlg::OnClose() -{ - ((JZPitchEvent *)Copy)->Value = Value; - return tChEventDlg::OnClose(); -} - -void tPitchDlg::AddProperties() -{ - sheet->AddProperty(new wxProperty( - "Pitch:", - wxPropertyValue(&Value), - "integer", - new wxIntegerListValidator(-8191, 8191))); - - tChEventDlg::AddProperties(); -} - // -------------------------------- Play track --------------------------- class tPlayTrackDlg : public tEventDlg @@ -560,16 +521,20 @@ break; } -// pDialog = new tKeyOnDlg(pEvent->IsKeyOn(), pPianoWindow, pTrack); { - JZKeyOnDialog KeyOnDialog(pEvent->IsKeyOn(), pPianoWindow); + JZKeyOnDialog KeyOnDialog(pEvent->IsKeyOn(), pTrack, pPianoWindow); KeyOnDialog.ShowModal(); } break; case StatPitch: - str = "Pitch Wheel"; - pDialog = new tPitchDlg(pEvent->IsPitch(), pPianoWindow, pTrack); + { + JZPitchWheelDialog PitchWheelDialog( + pEvent->IsPitch(), + pTrack, + pPianoWindow); + PitchWheelDialog.ShowModal(); + } break; case StatControl: Modified: trunk/jazz/src/Events.cpp =================================================================== --- trunk/jazz/src/Events.cpp 2010-04-27 03:37:28 UTC (rev 763) +++ trunk/jazz/src/Events.cpp 2010-04-27 03:39:37 UTC (rev 764) @@ -222,8 +222,5 @@ { return SX_GROUP_XG; } - else - { - return SX_GROUP_UNKNOWN; - } + return SX_GROUP_UNKNOWN; } Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2010-04-27 03:37:28 UTC (rev 763) +++ trunk/jazz/src/Makefile.am 2010-04-27 03:39:37 UTC (rev 764) @@ -33,6 +33,7 @@ Dialogs/MeterChangeDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/MidiChannelDialog.cpp \ +Dialogs/PitchWheelDialog.cpp \ Dialogs/ProgramChangeDialog.cpp \ Dialogs/QuantizeDialog.cpp \ Dialogs/SearchAndReplaceDialog.cpp \ @@ -128,6 +129,7 @@ Dialogs/MeterChangeDialog.cpp \ Dialogs/MetronomeSettingsDialog.cpp \ Dialogs/MidiChannelDialog.cpp \ +Dialogs/PitchWheelDialog.cpp \ Dialogs/ProgramChangeDialog.cpp \ Dialogs/QuantizeDialog.cpp \ Dialogs/SearchAndReplaceDialog.cpp \ @@ -228,6 +230,7 @@ Dialogs/MeterChangeDialog.h \ Dialogs/MetronomeSettingsDialog.h \ Dialogs/MidiChannelDialog.h \ +Dialogs/PitchWheelDialog.h \ Dialogs/ProgramChangeDialog.h \ Dialogs/QuantizeDialog.h \ Dialogs/SearchAndReplaceDialog.h \ Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-27 03:37:28 UTC (rev 763) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-04-27 03:39:37 UTC (rev 764) @@ -935,6 +935,14 @@ > </File> <File + RelativePath="..\src\Dialogs\PitchWheelDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\PitchWheelDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\ProgramChangeDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-05-10 06:05:44
|
Revision: 782 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=782&view=rev Author: pstieber Date: 2010-05-10 06:05:38 +0000 (Mon, 10 May 2010) Log Message: ----------- 1. Changed FAR PASCAL to CALLBACK. 2. Type cast some function to LPTIMECALLBACK for the 64-bit build. 3. Removed WIN32 from the 64-bit builds. Modified Paths: -------------- trunk/jazz/src/mswin/WindowsMidiInterface.cpp trunk/jazz/src/mswin/WindowsMidiInterface.h trunk/jazz/src/mswin/WindowsPlayer.cpp trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Modified: trunk/jazz/src/mswin/WindowsMidiInterface.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsMidiInterface.cpp 2010-05-10 04:08:59 UTC (rev 781) +++ trunk/jazz/src/mswin/WindowsMidiInterface.cpp 2010-05-10 06:05:38 UTC (rev 782) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -148,7 +148,7 @@ // handle incoming midi data (internal clock) -void FAR PASCAL midiIntInputHandler( +void CALLBACK midiIntInputHandler( HMIDIIN hMidiIn, WORD wMsg, DWORD dwInstance, @@ -186,12 +186,13 @@ } } - - - - // play output (internal clock) -void FAR PASCAL midiIntTimerHandler(UINT wTimerId, UINT wMsg, DWORD dwUser, DWORD dw1, DWORD dw2) +void CALLBACK midiIntTimerHandler( + UINT wTimerId, + UINT wMsg, + DWORD dwUser, + DWORD dw1, + DWORD dw2) { tWinPlayerState *state = (tWinPlayerState *)dwUser; if ( !state->playing ) @@ -203,7 +204,12 @@ midi_event *m = state->thru_buffer.peek(); if (midiOutShortMsg(state->hout, m->data) == MIDIERR_NOTREADY) { - timeSetEvent(state->min_timer_period, state->min_timer_period * 5, midiIntTimerHandler, (DWORD)state, TIME_ONESHOT); + timeSetEvent( + state->min_timer_period, + state->min_timer_period * 5, + (LPTIMECALLBACK) midiIntTimerHandler, + (DWORD) state, + TIME_ONESHOT); return; } (void)state->thru_buffer.get(); @@ -233,7 +239,12 @@ if (midiOutShortMsg(state->hout, m->data) == MIDIERR_NOTREADY) { // try again later - timeSetEvent(state->min_timer_period, state->min_timer_period * 5, midiIntTimerHandler, (DWORD)state, TIME_ONESHOT); + timeSetEvent( + state->min_timer_period, + state->min_timer_period * 5, + (LPTIMECALLBACK) midiIntTimerHandler, + (DWORD) state, + TIME_ONESHOT); return; } } @@ -251,15 +262,16 @@ delay = (long)state->min_timer_period; else if (delay > (long)state->max_timer_period) delay = (long)state->max_timer_period; - timeSetEvent((UINT)delay, state->min_timer_period, midiIntTimerHandler, (DWORD)state, TIME_ONESHOT); + timeSetEvent( + (UINT) delay, + state->min_timer_period, + (LPTIMECALLBACK) midiIntTimerHandler, + (DWORD) state, + TIME_ONESHOT); } - - - - // handle incoming midi data (midi clock source) (songpointer) -void FAR PASCAL midiMidiInputHandler( +void CALLBACK midiMidiInputHandler( HMIDIIN hMidiIn, WORD wMsg, DWORD dwInstance, @@ -307,12 +319,13 @@ } } - - - - // play output (midi clock source) (songpointer) -void FAR PASCAL midiMidiTimerHandler(UINT wTimerId, UINT wMsg, DWORD dwUser, DWORD dw1, DWORD dw2) +void CALLBACK midiMidiTimerHandler( + UINT wTimerId, + UINT wMsg, + DWORD dwUser, + DWORD dw1, + DWORD dw2) { tWinPlayerState *state = (tWinPlayerState *)dwUser; if ( !state->playing ) @@ -324,7 +337,12 @@ midi_event *m = state->thru_buffer.peek(); if (midiOutShortMsg(state->hout, m->data) == MIDIERR_NOTREADY) { - timeSetEvent(state->min_timer_period, state->min_timer_period * 5, midiMidiTimerHandler, (DWORD)state, TIME_ONESHOT); + timeSetEvent( + state->min_timer_period, + state->min_timer_period * 5, + (LPTIMECALLBACK) midiMidiTimerHandler, + (DWORD) state, + TIME_ONESHOT); return; } (void)state->thru_buffer.get(); @@ -359,7 +377,12 @@ if (midiOutShortMsg(state->hout, m->data) == MIDIERR_NOTREADY) { // try again later - timeSetEvent(state->min_timer_period, state->min_timer_period * 5, midiMidiTimerHandler, (DWORD)state, TIME_ONESHOT); + timeSetEvent( + state->min_timer_period, + state->min_timer_period * 5, + (LPTIMECALLBACK) midiMidiTimerHandler, + (DWORD) state, + TIME_ONESHOT); return; } } @@ -379,15 +402,16 @@ else if (delay > (long)state->max_timer_period) delay = (long)state->max_timer_period; - timeSetEvent((UINT)delay, state->min_timer_period, midiMidiTimerHandler, (DWORD)state, TIME_ONESHOT); + timeSetEvent( + (UINT) delay, + state->min_timer_period, + (LPTIMECALLBACK) midiMidiTimerHandler, + (DWORD) state, + TIME_ONESHOT); } - - - - // handle incoming midi data (MTC clock source) -void FAR PASCAL midiMtcInputHandler( +void CALLBACK midiMtcInputHandler( HMIDIIN hMidiIn, WORD wMsg, DWORD dwInstance, @@ -494,11 +518,13 @@ } } - - - // play output (MTC clock source) -void FAR PASCAL midiMtcTimerHandler(UINT wTimerId, UINT wMsg, DWORD dwUser, DWORD dw1, DWORD dw2) +void CALLBACK midiMtcTimerHandler( + UINT wTimerId, + UINT wMsg, + DWORD dwUser, + DWORD dw1, + DWORD dw2) { tWinPlayerState *state = (tWinPlayerState *)dwUser; if ( !state->playing ) @@ -512,7 +538,12 @@ midi_event *m = state->thru_buffer.peek(); if (midiOutShortMsg(state->hout, m->data) == MIDIERR_NOTREADY) { - timeSetEvent(state->min_timer_period, state->min_timer_period * 5, midiMtcTimerHandler, (DWORD)state, TIME_ONESHOT); + timeSetEvent( + state->min_timer_period, + state->min_timer_period * 5, + (LPTIMECALLBACK) midiMtcTimerHandler, + (DWORD) state, + TIME_ONESHOT); return; } (void)state->thru_buffer.get(); @@ -547,7 +578,12 @@ if (midiOutShortMsg(state->hout, m->data) == MIDIERR_NOTREADY) { // try again later - timeSetEvent(state->min_timer_period, state->min_timer_period * 5, midiMtcTimerHandler, (DWORD)state, TIME_ONESHOT); + timeSetEvent( + state->min_timer_period, + state->min_timer_period * 5, + (LPTIMECALLBACK) midiMtcTimerHandler, + (DWORD) state, + TIME_ONESHOT); return; } } @@ -565,11 +601,14 @@ delay = (long)state->min_timer_period; else if (delay > (long)state->max_timer_period) delay = (long)state->max_timer_period; - timeSetEvent((UINT)delay, state->min_timer_period, midiMtcTimerHandler, (DWORD)state, TIME_ONESHOT); + timeSetEvent( + (UINT) delay, + state->min_timer_period, + (LPTIMECALLBACK) midiMtcTimerHandler, + (DWORD) state, + TIME_ONESHOT); } - - void CALLBACK MidiOutProc( HMIDIOUT hmo, UINT wMsg, Modified: trunk/jazz/src/mswin/WindowsMidiInterface.h =================================================================== --- trunk/jazz/src/mswin/WindowsMidiInterface.h 2010-05-10 04:08:59 UTC (rev 781) +++ trunk/jazz/src/mswin/WindowsMidiInterface.h 2010-05-10 06:05:38 UTC (rev 782) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -29,13 +29,12 @@ extern "C" { -// in win-3.x this has to be in a dll! -void FAR PASCAL midiIntInputHandler(HMIDIIN, WORD, DWORD, DWORD, DWORD); -void FAR PASCAL midiMidiInputHandler(HMIDIIN, WORD, DWORD, DWORD, DWORD); -void FAR PASCAL midiMtcInputHandler(HMIDIIN, WORD, DWORD, DWORD, DWORD); -void FAR PASCAL midiIntTimerHandler(UINT, UINT, DWORD, DWORD, DWORD); -void FAR PASCAL midiMidiTimerHandler(UINT, UINT, DWORD, DWORD, DWORD); -void FAR PASCAL midiMtcTimerHandler(UINT, UINT, DWORD, DWORD, DWORD); +void CALLBACK midiIntInputHandler(HMIDIIN, WORD, DWORD, DWORD, DWORD); +void CALLBACK midiMidiInputHandler(HMIDIIN, WORD, DWORD, DWORD, DWORD); +void CALLBACK midiMtcInputHandler(HMIDIIN, WORD, DWORD, DWORD, DWORD); +void CALLBACK midiIntTimerHandler(UINT, UINT, DWORD, DWORD, DWORD); +void CALLBACK midiMidiTimerHandler(UINT, UINT, DWORD, DWORD, DWORD); +void CALLBACK midiMtcTimerHandler(UINT, UINT, DWORD, DWORD, DWORD); tWinPlayerState FAR * FAR PASCAL NewWinPlayerState(); void FAR PASCAL DeleteWinPlayerState(tWinPlayerState FAR * state); Modified: trunk/jazz/src/mswin/WindowsPlayer.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsPlayer.cpp 2010-05-10 04:08:59 UTC (rev 781) +++ trunk/jazz/src/mswin/WindowsPlayer.cpp 2010-05-10 06:05:38 UTC (rev 782) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -669,7 +669,12 @@ mpState->virtual_clock = Clock - mpState->ticks_per_signal; mpState->signal_time = mpState->start_time - 5000L; // mpState->playing = TRUE; - timeSetEvent(mpState->min_timer_period, mpState->min_timer_period, midiMidiTimerHandler, (DWORD)mpState, TIME_ONESHOT); + timeSetEvent( + mpState->min_timer_period, + mpState->min_timer_period, + (LPTIMECALLBACK) midiMidiTimerHandler, + (DWORD) mpState, + TIME_ONESHOT); break; case CsMtc: if (!Continue) @@ -698,8 +703,8 @@ timeSetEvent( mpState->min_timer_period, mpState->min_timer_period, - midiMtcTimerHandler, - (DWORD)mpState, + (LPTIMECALLBACK) midiMtcTimerHandler, + (DWORD) mpState, TIME_ONESHOT); break; case CsInt: @@ -709,8 +714,8 @@ timeSetEvent( mpState->min_timer_period, mpState->min_timer_period, - midiIntTimerHandler, - (DWORD)mpState, + (LPTIMECALLBACK) midiIntTimerHandler, + (DWORD) mpState, TIME_ONESHOT); break; } Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-05-10 04:08:59 UTC (rev 781) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-05-10 06:05:38 UTC (rev 782) @@ -117,7 +117,7 @@ /> </Configuration> <Configuration - Name="Release GUI VC9|Win32" + Name="Debug GUI VC9|x64" OutputDirectory="BuildDir\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="BuildDir\$(PlatformName)\$(ConfigurationName)" ConfigurationType="1" @@ -138,22 +138,20 @@ /> <Tool Name="VCMIDLTool" - PreprocessorDefinitions="NDEBUG" + PreprocessorDefinitions="_DEBUG" MkTypLibCompatible="true" SuppressStartupBanner="true" - TargetEnvironment="1" + TargetEnvironment="3" TypeLibraryName=".\$(OutDir)\JazzPlusPlus.tlb" HeaderFileName="" /> <Tool Name="VCCLCompilerTool" - Optimization="3" - InlineFunctionExpansion="1" - AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.11-VC9\lib\vc_lib\msw";"$(EXT_PKGS)\wxMSW-2.8.11-VC9\include";..\src;..\src\mswin" - PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WINVER=0x0400;STRICT;NOMINMAX" - StringPooling="true" - RuntimeLibrary="2" - EnableFunctionLevelLinking="true" + Optimization="0" + AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.11-VC9\lib\vc_lib_x64\mswd";"$(EXT_PKGS)\wxMSW-2.8.11-VC9\include";..\src;..\src\mswin" + PreprocessorDefinitions="_DEBUG;_WINDOWS;WINVER=0x0501;STRICT;NOMINMAX;__WXDEBUG__;WXDEBUG=1" + BasicRuntimeChecks="3" + RuntimeLibrary="3" ForceConformanceInForLoopScope="true" RuntimeTypeInfo="true" UsePrecompiledHeader="0" @@ -172,7 +170,7 @@ /> <Tool Name="VCResourceCompilerTool" - PreprocessorDefinitions="NDEBUG" + PreprocessorDefinitions="_DEBUG" Culture="1033" AdditionalIncludeDirectories="$(EXT_PKGS)\wxMSW-2.8.11-VC9\include" /> @@ -181,17 +179,18 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="wxmsw28_xrc.lib wxbase28_xml.lib wxexpat.lib wxmsw28_core.lib wxmsw28_adv.lib wxmsw28_html.lib wxbase28.lib wxpng.lib wxzlib.lib wxjpeg.lib wxtiff.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib opengl32.lib glu32.lib" + AdditionalDependencies="wxmsw28d_xrc.lib wxbase28d_xml.lib wxexpatd.lib wxmsw28d_core.lib wxmsw28d_adv.lib wxmsw28d_html.lib wxbase28d.lib wxpngd.lib wxzlibd.lib wxjpegd.lib wxtiffd.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib opengl32.lib glu32.lib" OutputFile=".\$(OutDir)\JazzPlusPlus.exe" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.11-VC9\lib\vc_lib"" + AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.11-VC9\lib\vc_lib_x64"" IgnoreDefaultLibraryNames="" + GenerateDebugInformation="true" ProgramDatabaseFile=".\$(OutDir)\JazzPlusPlus.pdb" SubSystem="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" - TargetMachine="1" + TargetMachine="17" /> <Tool Name="VCALinkTool" @@ -216,7 +215,7 @@ /> </Configuration> <Configuration - Name="Debug GUI VC9|x64" + Name="Release GUI VC9|Win32" OutputDirectory="BuildDir\$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="BuildDir\$(PlatformName)\$(ConfigurationName)" ConfigurationType="1" @@ -237,20 +236,22 @@ /> <Tool Name="VCMIDLTool" - PreprocessorDefinitions="_DEBUG" + PreprocessorDefinitions="NDEBUG" MkTypLibCompatible="true" SuppressStartupBanner="true" - TargetEnvironment="3" + TargetEnvironment="1" TypeLibraryName=".\$(OutDir)\JazzPlusPlus.tlb" HeaderFileName="" /> <Tool Name="VCCLCompilerTool" - Optimization="0" - AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.11-VC9\lib\vc_lib_x64\mswd";"$(EXT_PKGS)\wxMSW-2.8.11-VC9\include";..\src;..\src\mswin" - PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;WINVER=0x0400;STRICT;NOMINMAX;__WXDEBUG__;WXDEBUG=1" - BasicRuntimeChecks="3" - RuntimeLibrary="3" + Optimization="3" + InlineFunctionExpansion="1" + AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.11-VC9\lib\vc_lib\msw";"$(EXT_PKGS)\wxMSW-2.8.11-VC9\include";..\src;..\src\mswin" + PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WINVER=0x0400;STRICT;NOMINMAX" + StringPooling="true" + RuntimeLibrary="2" + EnableFunctionLevelLinking="true" ForceConformanceInForLoopScope="true" RuntimeTypeInfo="true" UsePrecompiledHeader="0" @@ -269,7 +270,7 @@ /> <Tool Name="VCResourceCompilerTool" - PreprocessorDefinitions="_DEBUG" + PreprocessorDefinitions="NDEBUG" Culture="1033" AdditionalIncludeDirectories="$(EXT_PKGS)\wxMSW-2.8.11-VC9\include" /> @@ -278,18 +279,17 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="wxmsw28d_xrc.lib wxbase28d_xml.lib wxexpatd.lib wxmsw28d_core.lib wxmsw28d_adv.lib wxmsw28d_html.lib wxbase28d.lib wxpngd.lib wxzlibd.lib wxjpegd.lib wxtiffd.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib opengl32.lib glu32.lib" + AdditionalDependencies="wxmsw28_xrc.lib wxbase28_xml.lib wxexpat.lib wxmsw28_core.lib wxmsw28_adv.lib wxmsw28_html.lib wxbase28.lib wxpng.lib wxzlib.lib wxjpeg.lib wxtiff.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib opengl32.lib glu32.lib" OutputFile=".\$(OutDir)\JazzPlusPlus.exe" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.11-VC9\lib\vc_lib_x64"" + AdditionalLibraryDirectories=""$(EXT_PKGS)\wxMSW-2.8.11-VC9\lib\vc_lib"" IgnoreDefaultLibraryNames="" - GenerateDebugInformation="true" ProgramDatabaseFile=".\$(OutDir)\JazzPlusPlus.pdb" SubSystem="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" - TargetMachine="17" + TargetMachine="1" /> <Tool Name="VCALinkTool" @@ -347,7 +347,7 @@ Optimization="3" InlineFunctionExpansion="1" AdditionalIncludeDirectories=""$(EXT_PKGS)\wxMSW-2.8.11-VC9\lib\vc_lib_x64\msw";"$(EXT_PKGS)\wxMSW-2.8.11-VC9\include";..\src;..\src\mswin" - PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;WINVER=0x0400;STRICT;NOMINMAX" + PreprocessorDefinitions="NDEBUG;_WINDOWS;WINVER=0x0501;STRICT;NOMINMAX" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -361,6 +361,7 @@ WarningLevel="3" SuppressStartupBanner="true" DebugInformationFormat="3" + CallingConvention="2" CompileAs="0" DisableSpecificWarnings="4351" /> @@ -456,7 +457,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release GUI VC9|Win32" + Name="Debug GUI VC9|x64" ExcludedFromBuild="true" > <Tool @@ -464,7 +465,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug GUI VC9|x64" + Name="Release GUI VC9|Win32" ExcludedFromBuild="true" > <Tool @@ -492,7 +493,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Release GUI VC9|Win32" + Name="Debug GUI VC9|x64" ExcludedFromBuild="true" > <Tool @@ -500,7 +501,7 @@ /> </FileConfiguration> <FileConfiguration - Name="Debug GUI VC9|x64" + Name="Release GUI VC9|Win32" ExcludedFromBuild="true" > <Tool @@ -1095,22 +1096,22 @@ /> </FileConfiguration> <FileConfiguration - Name="Release GUI VC9|Win32" + Name="Debug GUI VC9|x64" > <Tool Name="VCCustomBuildTool" + Description="Performing Custom Help Build Step" CommandLine="echo cd "$(InputDir)"
cd "$(InputDir)"
echo $(EXT_PKGS)\wxMSW-2.8.11-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
$(EXT_PKGS)\wxMSW-2.8.11-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
" - Outputs="$(InputDir)$(InputName)_contents.html" + Outputs="$(InputDir)$(InputName)_contents.html;$(InputDir)$(InputName).hhc;$(InputDir)$(InputName).hhp;$(InputDir)$(InputName).hhk;$(InputDir)$(InputName).ref;$(InputDir)$(InputName).con;$(InputDir)$(InputName).htx" /> </FileConfiguration> <FileConfiguration - Name="Debug GUI VC9|x64" + Name="Release GUI VC9|Win32" > <Tool Name="VCCustomBuildTool" - Description="Performing Custom Help Build Step" CommandLine="echo cd "$(InputDir)"
cd "$(InputDir)"
echo $(EXT_PKGS)\wxMSW-2.8.11-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
$(EXT_PKGS)\wxMSW-2.8.11-VC9\bin\tex2rtf "$(InputName).tex" "$(InputName).html" -html -twice
" - Outputs="$(InputDir)$(InputName)_contents.html;$(InputDir)$(InputName).hhc;$(InputDir)$(InputName).hhp;$(InputDir)$(InputName).hhk;$(InputDir)$(InputName).ref;$(InputDir)$(InputName).con;$(InputDir)$(InputName).htx" + Outputs="$(InputDir)$(InputName)_contents.html" /> </FileConfiguration> <FileConfiguration This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-11 21:19:51
|
Revision: 788 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=788&view=rev Author: pstieber Date: 2010-07-11 21:19:45 +0000 (Sun, 11 Jul 2010) Log Message: ----------- 1. Added a new version of the audio samples dialog (Dialogs/SamplesDialog.cpp.h) to replace the use of tSamplesDlg. I added the controls and laid them out, but the dialog is not functioning. 2. Changes an unnamed enumeration in tSampleSet that held MAXSMPL to a named enumeration (TESampleSize) with a single entry called eSampleCount, and made the enumeration public. 3. Changed the sample class label data member from a char* to a std::string. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h trunk/jazz/src/Makefile.am trunk/jazz/src/PianoWindow.cpp trunk/jazz/src/Player.h trunk/jazz/src/Sample.cpp trunk/jazz/src/Sample.h trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/SamplesDialog.cpp trunk/jazz/src/Dialogs/SamplesDialog.h Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-07-03 14:12:43 UTC (rev 787) +++ trunk/jazz/src/Audio.cpp 2010-07-11 21:19:45 UTC (rev 788) @@ -22,6 +22,7 @@ #include "Audio.h" +#include "Dialogs/SamplesDialog.h" #include "Sample.h" #include "Events.h" #include "RecordingInfo.h" @@ -211,7 +212,7 @@ is_playing = 0; dirty = 0; - for (i = 0; i < MAXSMPL; i++) + for (i = 0; i < eSampleCount; i++) { mSamples[i] = new tSample(*this); mSampleWindows[i] = 0; @@ -229,7 +230,7 @@ tSampleSet::~tSampleSet() { int i; - for (i = 0; i < MAXSMPL; i++) + for (i = 0; i < eSampleCount; i++) { delete mSamples[i]; delete mSampleWindows[i]; @@ -280,7 +281,7 @@ gpMidiPlayer->SetAudioEnabled(true); wxBeginBusyCursor(); - for (int i = 0; i < MAXSMPL; i++) + for (int i = 0; i < eSampleCount; i++) { mSamples[i]->Clear(); } @@ -319,7 +320,7 @@ ::wxMessageBox(String, "Error", wxOK); continue; } - assert(0 <= key && key < MAXSMPL); + assert(0 <= key && key < eSampleCount); mSamples[key]->SetFilename(SplFilePath.c_str()); mSamples[key]->SetLabel(Label.c_str()); mSamples[key]->SetVolume(vol); @@ -348,7 +349,7 @@ //----------------------------------------------------------------------------- void tSampleSet::ReloadSamples() { - for (int i = 0; i < MAXSMPL; i++) + for (int i = 0; i < eSampleCount; i++) { mSamples[i]->Load(dirty); } @@ -359,23 +360,22 @@ //----------------------------------------------------------------------------- int tSampleSet::Save(const wxString& FileName) { - ofstream os(FileName.c_str()); - os << 1 << " " << speed << " " << channels << " " << softsync << endl; - for (int i = 0; i < MAXSMPL; i++) + ofstream Ofs(FileName.c_str()); + Ofs << 1 << ' ' << speed << ' ' << channels << ' ' << softsync << endl; + for (int i = 0; i < eSampleCount; i++) { - tSample *spl = mSamples[i]; - const char *fname = spl->GetFilename(); - const char* pLabel = spl->GetLabel(); - int vol = spl->GetVolume(); - int pan = spl->GetPan(); - int pitch = spl->GetPitch(); + tSample* pSample = mSamples[i]; + const char* fname = pSample->GetFilename(); + int vol = pSample->GetVolume(); + int pan = pSample->GetPan(); + int pitch = pSample->GetPitch(); if (fname[0]) { - os << i << " "; - WriteString(os, fname); - os << " "; - WriteString(os, pLabel); - os << " " << pan << " " << vol << " " << pitch << endl; + Ofs << i << ' '; + WriteString(Ofs, fname); + Ofs << ' '; + WriteString(Ofs, pSample->GetLabel()); + Ofs << ' ' << pan << ' ' << vol << ' ' << pitch << endl; } } return 0; @@ -383,13 +383,14 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -const char* tSampleSet::GetSampleName(int i) +const string& tSampleSet::GetSampleLabel(int Index) { - if (0 <= i && i < MAXSMPL) + if (Index >= 0 && Index < eSampleCount) { - return mSamples[i]->GetLabel(); + return mSamples[Index]->GetLabel(); } - return ""; + static string EmptyString; + return EmptyString; } //----------------------------------------------------------------------------- @@ -611,7 +612,7 @@ ReloadSamples(); // touch all playback sample data, so they may get swapped into memory - for (int i = 0; i < MAXSMPL; i++) + for (int i = 0; i < eSampleCount; i++) { tSample *spl = mSamples[i]; spl->GotoRAM(); @@ -627,6 +628,7 @@ is_playing = 0; } +#if 0 //***************************************************************************** // Description: // This is the sample dialog. @@ -672,7 +674,7 @@ wxText* pFile; #endif // OBSOLETE - static char *path; + static char* mpSamplePath; static int current; char *ListEntry(int i); @@ -680,6 +682,7 @@ void Win2Sample(int index); void SetCurrentListEntry(int i); }; +#endif // ----------------------------------------------------------------- // ------------------------ global settings ------------------------ @@ -899,7 +902,7 @@ { return; } - for (int i = 0; i < MAXSMPL; ++i) + for (int i = 0; i < eSampleCount; ++i) { mSamples[i]->Clear(); } @@ -951,7 +954,7 @@ tSample *spl; // see if fname is already present in sample list - for (i = 0; i < MAXSMPL; i++) + for (i = 0; i < eSampleCount; i++) { spl = mSamples[i]; if (strcmp(spl->GetFilename(), fname) == 0) @@ -959,10 +962,10 @@ } // if no entry is there, add an entry - if (i >= MAXSMPL) + if (i >= eSampleCount) { // start somewhere near the top of the list - for (i = 15; i < MAXSMPL; i++) + for (i = 15; i < eSampleCount; i++) { spl = mSamples[i]; if (spl->GetFilename()[0] == 0) @@ -970,7 +973,7 @@ } } - if (i >= MAXSMPL) + if (i >= eSampleCount) return; int key = i; @@ -1114,11 +1117,11 @@ // ------------------------ sample settings ------------------------ // ----------------------------------------------------------------- - +#if 0 //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -char * tSamplesDlg::path = 0; -int tSamplesDlg::current = 0; +char* tSamplesDlg::mpSamplePath = 0; +int tSamplesDlg::current = 0; //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -1126,13 +1129,13 @@ : wxDialog(pParent, wxID_ANY, wxString("Sample Settings")), set(s) { - if (path == 0) + if (mpSamplePath == 0) { - path = copystring("*.wav"); + mpSamplePath = copystring("*.wav"); } wxArrayString SampleNames; - for (int i = 0; i < tSampleSet::MAXSMPL; i++) + for (int i = 0; i < tSampleSet::eSampleCount; ++i) { SampleNames.Add(ListEntry(i)); } @@ -1182,7 +1185,7 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -char *tSamplesDlg::ListEntry(int i) +char* tSamplesDlg::ListEntry(int i) { ostringstream Oss; Oss << i + 1 << ' ' << set.mSamples[i]->GetLabel(); @@ -1241,7 +1244,9 @@ void tSamplesDlg::OnCloseButton() { if (set.is_playing) + { return; + } Win2Sample(current); wxBeginBusyCursor(); set.ReloadSamples(); @@ -1255,12 +1260,18 @@ //----------------------------------------------------------------------------- void tSamplesDlg::OnAddButton() { - wxString fname = file_selector(path, "Load Sample", false, false, "*.wav"); - if (fname) + wxString FileName = file_selector( + mpSamplePath, + "Load Sample", + false, + false, + "*.wav"); + + if (FileName) { #ifdef OBSOLETE - file->SetValue(fname); - pLabel->SetValue(wxFileNameFromPath(fname)); + file->SetValue(FileName); + pLabel->SetValue(wxFileNameFromPath(FileName)); #endif Win2Sample(current); SetCurrentListEntry(current); @@ -1365,6 +1376,7 @@ ((tSamplesDlg *)itm.GetParent())->OnListClick(); } #endif // OBSOLETE +#endif //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- @@ -1377,7 +1389,7 @@ } if (mpSampleDialog == 0) { - mpSampleDialog = new tSamplesDlg(gpTrackWindow, *this); + mpSampleDialog = new JZSamplesDialog(gpTrackWindow, *this); } mpSampleDialog->Show(true); } @@ -1388,6 +1400,6 @@ { if (mpSampleDialog) { - mpSampleDialog->Sample2Win(mpSampleDialog->current); +// mpSampleDialog->Sample2Win(mpSampleDialog->current); } } Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2010-07-03 14:12:43 UTC (rev 787) +++ trunk/jazz/src/Audio.h 2010-07-11 21:19:45 UTC (rev 788) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -219,7 +219,7 @@ // tSampleSet // ============================================================= -class tSamplesDlg; +class JZSamplesDialog; //***************************************************************************** //***************************************************************************** @@ -230,13 +230,17 @@ friend class tSampleVoice; friend class tSample; friend class tAudioGloblForm; - friend class tSamplesDlg; friend class JZWindowsAudioPlayer; friend class tAudioPlayer; friend class tAlsaAudioPlayer; public: + enum TESampleSize + { + eSampleCount = 128 + }; + tSampleSet(long ticks_per_minute); virtual ~tSampleSet(); @@ -338,7 +342,7 @@ return (long)(0.001 * time * speed * channels); } - virtual const char *GetSampleName(int i); + virtual const std::string& GetSampleLabel(int Index); void StartPlay(long clock); @@ -401,12 +405,8 @@ int bits; // must be 16! bool softsync; // enable software midi/audio sync - enum - { - MAXSMPL = 128 - }; - tSample* mSamples[MAXSMPL]; - tSampleWin* mSampleWindows[MAXSMPL]; + tSample* mSamples[eSampleCount]; + tSampleWin* mSampleWindows[eSampleCount]; long ticks_per_minute; // midi speed for audio/midi sync double clocks_per_buffer; @@ -425,7 +425,7 @@ long buffers_written; // for computing buffers clock wxDialog* mpGlobalSettingsDialog; - tSamplesDlg* mpSampleDialog; + JZSamplesDialog* mpSampleDialog; tEventArray* events; Added: trunk/jazz/src/Dialogs/SamplesDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/SamplesDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/SamplesDialog.cpp 2010-07-11 21:19:45 UTC (rev 788) @@ -0,0 +1,181 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#include "SamplesDialog.h" + +#include "../Audio.h" + +#include <wx/button.h> +#include <wx/listbox.h> +#include <wx/sizer.h> +#include <wx/slider.h> +#include <wx/stattext.h> +#include <wx/textctrl.h> + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZSamplesDialog::JZSamplesDialog(wxWindow* pParent, tSampleSet& SampleSet) + : wxDialog(pParent, wxID_ANY, wxString("Samples Settings")), + mpListBox(0), + mpLabelEdit(0), + mpFileNameEdit(0), + mpFileNameBrowseButton(0), + mpVolumeSlider(0), + mpPanSlider(0), + mpPitchSlider(0) +{ + wxArrayString SampleNames; + for (int Index = 0; Index < tSampleSet::eSampleCount; ++Index) + { + wxString Entry; + Entry << Index + 1 << ' ' << SampleSet.GetSampleLabel(Index); + SampleNames.push_back(Entry); + } + + mpListBox = new wxListBox( + this, + wxID_ANY, + wxDefaultPosition, + wxDefaultSize, + SampleNames, + wxLB_SINGLE); + + mpLabelEdit = new wxTextCtrl(this, wxID_ANY); + + mpFileNameEdit = new wxTextCtrl(this, wxID_ANY); + + mpFileNameBrowseButton = new wxButton( + this, + wxID_ANY, +// IDC_BN_SD_FILE_SELECT_BROWSE, + "Browse..."); + + mpVolumeSlider = new wxSlider( + this, + wxID_ANY, + 64, + 0, + 127, + wxDefaultPosition, + wxDefaultSize, + wxSL_LABELS); + + mpPanSlider = new wxSlider( + this, + wxID_ANY, + 0, + -63, + 63, + wxDefaultPosition, + wxDefaultSize, + wxSL_LABELS); + + mpPitchSlider = new wxSlider( + this, + wxID_ANY, + 0, + -12, + 12, + wxDefaultPosition, + wxDefaultSize, + wxSL_LABELS); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + wxFlexGridSizer* pFlexGridSizer; + + pTopSizer->Add( + new wxStaticText(this, wxID_ANY, "Samples"), + 0, + wxLEFT | wxALL, + 3); + pTopSizer->Add(mpListBox, 0, wxGROW | wxALL, 3); + + pFlexGridSizer = new wxFlexGridSizer(1, 2, 4, 2); + pFlexGridSizer->AddGrowableCol(1); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Sample Label:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpLabelEdit, + 1, + wxGROW | wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxGROW | wxALL, 5); + + pFlexGridSizer = new wxFlexGridSizer(1, 3, 4, 2); + + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Sample File Name:"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpFileNameEdit, + 1, + wxGROW | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpFileNameBrowseButton, + 0, + wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); + + pTopSizer->Add(pFlexGridSizer, 0, wxGROW | wxALL, 5); + + pTopSizer->Add( + new wxStaticText(this, wxID_ANY, "Volume"), + 0, + wxCENTER | wxALL, + 3); + pTopSizer->Add(mpVolumeSlider, 0, wxGROW | wxALL, 3); + + pTopSizer->Add( + new wxStaticText(this, wxID_ANY, "Pan"), + 0, + wxCENTER | wxALL, + 3); + pTopSizer->Add(mpPanSlider, 0, wxGROW | wxALL, 3); + + pTopSizer->Add( + new wxStaticText(this, wxID_ANY, "Pitch"), + 0, + wxCENTER | wxALL, + 3); + pTopSizer->Add(mpPitchSlider, 0, wxGROW | wxALL, 3); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} Property changes on: trunk/jazz/src/Dialogs/SamplesDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/SamplesDialog.h =================================================================== --- trunk/jazz/src/Dialogs/SamplesDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/SamplesDialog.h 2010-07-11 21:19:45 UTC (rev 788) @@ -0,0 +1,53 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_SAMPLESDIALOG_H +#define JZ_SAMPLESDIALOG_H + +#include <wx/dialog.h> + +class tSampleSet; +class wxButton; +class wxListBox; +class wxSlider; +class wxTextCtrl; + +//***************************************************************************** +// Description: +// This is the sample dialog class declaration. +//***************************************************************************** +class JZSamplesDialog : public wxDialog +{ + public: + + JZSamplesDialog(wxWindow* pParent, tSampleSet& SampleSet); + + private: + + wxListBox* mpListBox; + wxTextCtrl* mpLabelEdit; + wxTextCtrl* mpFileNameEdit; + wxButton* mpFileNameBrowseButton; + wxSlider* mpVolumeSlider; + wxSlider* mpPanSlider; + wxSlider* mpPitchSlider; +}; + +#endif // !defined(JZ_SAMPLESDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/SamplesDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2010-07-03 14:12:43 UTC (rev 787) +++ trunk/jazz/src/Makefile.am 2010-07-11 21:19:45 UTC (rev 788) @@ -36,6 +36,7 @@ Dialogs/PitchWheelDialog.cpp \ Dialogs/ProgramChangeDialog.cpp \ Dialogs/QuantizeDialog.cpp \ +Dialogs/SamplesDialog.cpp \ Dialogs/SearchAndReplaceDialog.cpp \ Dialogs/SetTempoDialog.cpp \ Dialogs/ShiftDialog.cpp \ @@ -132,6 +133,7 @@ Dialogs/PitchWheelDialog.cpp \ Dialogs/ProgramChangeDialog.cpp \ Dialogs/QuantizeDialog.cpp \ +Dialogs/SamplesDialog.cpp \ Dialogs/SearchAndReplaceDialog.cpp \ Dialogs/SetTempoDialog.cpp \ Dialogs/ShiftDialog.cpp \ @@ -233,6 +235,7 @@ Dialogs/PitchWheelDialog.h \ Dialogs/ProgramChangeDialog.h \ Dialogs/QuantizeDialog.h \ +Dialogs/SamplesDialog.h \ Dialogs/SearchAndReplaceDialog.h \ Dialogs/SetTempoDialog.h \ Dialogs/ShiftDialog.h \ Modified: trunk/jazz/src/PianoWindow.cpp =================================================================== --- trunk/jazz/src/PianoWindow.cpp 2010-07-03 14:12:43 UTC (rev 787) +++ trunk/jazz/src/PianoWindow.cpp 2010-07-11 21:19:45 UTC (rev 788) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008-2009 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -1336,7 +1336,7 @@ Dc.SetFont(*mpDrumFont); while (Pitch >= 0 && y < mEventsY + mEventsHeight) { - Dc.DrawText(gpMidiPlayer->GetSampleName(Pitch), mLittleBit, y); + Dc.DrawText(gpMidiPlayer->GetSampleLabel(Pitch), mLittleBit, y); y += mTrackHeight; --Pitch; } Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2010-07-03 14:12:43 UTC (rev 787) +++ trunk/jazz/src/Player.h 2010-07-11 21:19:45 UTC (rev 788) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -261,9 +261,9 @@ return 0; } - virtual const char *GetSampleName(int i) + virtual const std::string& GetSampleLabel(int Index) { - return mSamples.GetSampleName(i); + return mSamples.GetSampleLabel(Index); } virtual void AdjustAudioLength(JZTrack *t) Modified: trunk/jazz/src/Sample.cpp =================================================================== --- trunk/jazz/src/Sample.cpp 2010-07-03 14:12:43 UTC (rev 787) +++ trunk/jazz/src/Sample.cpp 2010-07-11 21:19:45 UTC (rev 788) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -28,26 +28,24 @@ #include "DeprecatedStringUtils.h" #include "Mapper.h" +#include <cassert> +#include <cmath> #include <cstdlib> -#include <iostream> +#include <cstring> #include <fstream> -#include <cmath> -using namespace std; - -#include <assert.h> #include <sys/stat.h> -#include <string.h> +using namespace std; tSample::tSample(tSampleSet &s) - : set(s) + : set(s), + mLabel() { data = 0; length = 0; external_flag = 1; // auto reload when file changes on disk external_time = 0; - label = copystring(""); filename = copystring(""); volume = 127; pan = 0; @@ -59,14 +57,12 @@ tSample::~tSample() { delete [] data; - delete [] label; delete [] filename; } -void tSample::SetLabel(const char *str) +void tSample::SetLabel(const std::string& Label) { - delete [] label; - label = copystring(str); + mLabel = Label; } void tSample::SetFilename(const char *fname) @@ -75,7 +71,7 @@ { dirty = 1; char *s = copystring(fname); - label = copystring(wxFileNameFromPath(s)); + mLabel = wxFileNameFromPath(s); delete [] s; } delete [] filename; @@ -85,8 +81,7 @@ void tSample::Clear() { FreeData(); - delete [] label; - label = copystring(""); + mLabel.clear(); delete [] filename; filename = copystring(""); volume = 127; Modified: trunk/jazz/src/Sample.h =================================================================== --- trunk/jazz/src/Sample.h 2010-07-03 14:12:43 UTC (rev 787) +++ trunk/jazz/src/Sample.h 2010-07-11 21:19:45 UTC (rev 788) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -25,12 +25,12 @@ class tSampleSet; +#include <cmath> +#include <cstring> #include <iostream> -#include <cmath> +#include <string> -#include <assert.h> #include <sys/stat.h> -#include <string.h> #include "SignalInterface.h" @@ -219,10 +219,10 @@ int Save(); // Properties - void SetLabel(const char *str); - const char *GetLabel() const + void SetLabel(const std::string& Label); + const std::string& GetLabel() const { - return label; + return mLabel; } void SetVolume(int vol) @@ -400,12 +400,18 @@ void FreeData(); void MakeData(int length, int zero = 1); - int Convert(std::istream& is, int byte_count, int channels, int bits, int speed); + int Convert( + std::istream& is, + int byte_count, + int channels, + int bits, + int speed); + int length; // number of shorts short* data; // signed shorts tSampleSet& set; - char* label; // msvc cannot delete 'const char *' ???? + std::string mLabel; char* filename; int volume; int pan; @@ -421,7 +427,6 @@ int external_flag; // reload on disk change? int external_time; // last modified on disk - }; #endif // !defined(JZ_SAMPLE_H) Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-07-03 14:12:43 UTC (rev 787) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-07-11 21:19:45 UTC (rev 788) @@ -1241,6 +1241,14 @@ > </File> <File + RelativePath="..\src\Dialogs\SamplesDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\SamplesDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\SearchAndReplaceDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-12 01:22:05
|
Revision: 790 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=790&view=rev Author: pstieber Date: 2010-07-12 01:21:59 +0000 (Mon, 12 Jul 2010) Log Message: ----------- 1. Added a new audio settings dialog. I added the controls, but it isn't functional. 2. Reordered includes, removed an unused macro, and updated the tSampleVoice class comment header in Audio.cpp. 3. Changed speed to mSamplingRate in tSampleSet and renamed the accessors and mutators accordingly. 4. Changed channels to mChannelCount in tSampleSet and renamed the accessors and mutators accordingly. 5. Changed GetAudioEnabled and SetAudioEnabled to use bool instead of int. 3. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Audio.h trunk/jazz/src/Makefile.am trunk/jazz/src/Player.h trunk/jazz/src/Sample.cpp trunk/jazz/src/Sample.h trunk/jazz/src/SampleCommand.cpp trunk/jazz/src/SampleDialog.cpp trunk/jazz/src/SampleWindow.cpp trunk/jazz/src/Signal2.cpp trunk/jazz/src/Signal2.h trunk/jazz/src/mswin/WindowsAudioInterface.cpp trunk/jazz/src/mswin/WindowsAudioInterface.h trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Added Paths: ----------- trunk/jazz/src/Dialogs/AudioSettingsDialog.cpp trunk/jazz/src/Dialogs/AudioSettingsDialog.h Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/Audio.cpp 2010-07-12 01:21:59 UTC (rev 790) @@ -22,22 +22,23 @@ #include "Audio.h" +#include "Dialogs/AudioSettingsDialog.h" #include "Dialogs/SamplesDialog.h" -#include "Sample.h" #include "Events.h" -#include "RecordingInfo.h" -#include "Track.h" +#include "FileSelector.h" +#include "FindFile.h" #include "Globals.h" +#include "Help.h" #include "Player.h" -#include "TrackFrame.h" -#include "TrackWindow.h" -#include "SampleWindow.h" #include "Random.h" -#include "FindFile.h" -#include "FileSelector.h" -#include "StringReadWrite.h" -#include "Help.h" +#include "RecordingInfo.h" #include "Resources.h" +#include "Sample.h" +#include "SampleWindow.h" +#include "StringReadWrite.h" +#include "Track.h" +#include "TrackFrame.h" +#include "TrackWindow.h" #include <wx/filename.h> #include <wx/listbox.h> @@ -56,18 +57,17 @@ using namespace std; -#define db(a) cout << #a << " = " << a << endl - //***************************************************************************** +// Description: +// This is the sample voice class declaration. This class is activated via a +// MIDI note on signal. The class copies data from a tSample object to the +// output buffer as needed by the driver. //***************************************************************************** class tSampleVoice { - // Activated on note on. Copies data from a tSample object to the output - // buffer as needed by the driver. - public: - tSampleVoice(tSampleSet &s) + tSampleVoice(tSampleSet& s) : set(s) { } @@ -189,11 +189,10 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- tSampleSet::tSampleSet(long tpm) - : speed(22050), - channels(1), + : mSamplingRate(22050), + mChannelCount(1), bits(16), // dont change!! softsync(1), - mpGlobalSettingsDialog(0), mpSampleDialog(0), mDefaultFileName("noname.spl"), mRecordFileName("noname.wav") @@ -291,7 +290,7 @@ ifstream Is(FileName.c_str()); int Version; - Is >> Version >> speed >> channels >> softsync; + Is >> Version >> mSamplingRate >> mChannelCount >> softsync; while (Is) { int key, pan, vol, pitch; @@ -361,7 +360,9 @@ int tSampleSet::Save(const wxString& FileName) { ofstream Ofs(FileName.c_str()); - Ofs << 1 << ' ' << speed << ' ' << channels << ' ' << softsync << endl; + Ofs + << 1 << ' ' << mSamplingRate << ' ' << mChannelCount << ' ' << softsync + << endl; for (int i = 0; i < eSampleCount; i++) { tSample* pSample = mSamples[i]; @@ -518,8 +519,8 @@ } //----------------------------------------------------------------------------- -// returns the number of buffers containing sound. Fills as many -// buffers as possible, the last buffers may contain silence only. +// Returns the number of buffers containing sound. Fills as many buffers as +// possible, the last buffers may contain silence only. //----------------------------------------------------------------------------- int tSampleSet::PrepareListen(tSample *spl, long fr_smpl, long to_smpl) { @@ -684,9 +685,6 @@ }; #endif -// ----------------------------------------------------------------- -// ------------------------ global settings ------------------------ -// ----------------------------------------------------------------- #ifdef OBSOLETE class tAudioGloblForm : public wxForm @@ -694,7 +692,7 @@ public: tAudioGloblForm(tSampleSet &s) : wxForm( USED_WXFORM_BUTTONS ), - set(s) + mSampleSet(s) { ossbug1 = gpConfig->GetValue(C_OssBug1); @@ -709,7 +707,7 @@ "44100", 0 }; - speed = set.GetSpeed(); + speed = mSampleSet.GetSamplingRate(); speedstr = 0; for (int i = 0; speedtxt[i]; i++) { @@ -725,8 +723,8 @@ } enable = gpMidiPlayer->GetAudioEnabled(); - stereo = (set.GetChannels() == 2); - softsync = set.GetSoftSync(); + stereo = (mSampleSet.GetChannelCount() == 2); + softsync = mSampleSet.GetSoftSync(); Add(wxMakeFormBool("Enable Audio", &enable)); Add(wxMakeFormNewLine()); @@ -756,14 +754,14 @@ void OnOk() { - if (set.is_playing) + if (mSampleSet.is_playing) return; wxBeginBusyCursor(); - set.mpGlobalSettingsDialog = 0; + mSampleSet.mpGlobalSettingsDialog = 0; speed = atol(speedstr); - set.SetSpeed(speed); - set.SetChannels(stereo ? 2 : 1); - set.SetSoftSync(softsync); + mSampleSet.SetSamplingRate(speed); + mSampleSet.SetChannelCount(stereo ? 2 : 1); + mSampleSet.SetSoftSync(softsync); gpMidiPlayer->SetAudioEnabled(enable); if (gpConfig->GetValue(C_EnableAudio) != enable) @@ -791,17 +789,17 @@ } if (enable) - set.ReloadSamples(); + mSampleSet.ReloadSamples(); wxEndBusyCursor(); wxForm::OnOk(); } void OnCancel() { - set.mpGlobalSettingsDialog = 0; + mSampleSet.mpGlobalSettingsDialog = 0; wxForm::OnCancel(); } private: - tSampleSet &set; + tSampleSet& mSampleSet; wxList strlist; long speed; @@ -826,16 +824,8 @@ return; } - if (mpGlobalSettingsDialog == 0) - { - mpGlobalSettingsDialog = new wxDialog(pParent, wxID_ANY, "Audio Settings"); -#ifdef OBSOLETE - tAudioGloblForm *form = new tAudioGloblForm(*this); - form->AssociatePanel(mpGlobalSettingsDialog); - mpGlobalSettingsDialog->Fit(); -#endif // OBSOLETE - } - mpGlobalSettingsDialog->Show(true); + JZAudioSettingsDialog AudioSettingsDialog(pParent, *this); + AudioSettingsDialog.ShowModal(); } //----------------------------------------------------------------------------- @@ -896,7 +886,7 @@ //----------------------------------------------------------------------------- void tSampleSet::ClearSampleSet(wxWindow* pParent) { - if (mpSampleDialog == 0 && mpGlobalSettingsDialog == 0) + if (mpSampleDialog == 0) { if (wxMessageBox("Clear Sample Set?", "Confirm", wxYES_NO) == wxNO) { @@ -1031,11 +1021,11 @@ wh.sub_chunk = FMT; wh.data_chunk = DATA; wh.format = PCM_CODE; - wh.modus = channels; + wh.modus = mChannelCount; wh.sc_len = 16; - wh.sample_fq = speed; + wh.sample_fq = mSamplingRate; wh.bit_p_spl = bits; - wh.byte_p_spl = channels * (bits > 8 ? 2 : 1); + wh.byte_p_spl = mChannelCount * (bits > 8 ? 2 : 1); wh.byte_p_sec = wh.byte_p_spl * wh.sample_fq; @@ -1386,11 +1376,6 @@ //----------------------------------------------------------------------------- void tSampleSet::SamplesDlg() { - if (mpGlobalSettingsDialog) - { - mpGlobalSettingsDialog->Show(true); - return; - } if (mpSampleDialog == 0) { mpSampleDialog = new JZSamplesDialog(gpTrackWindow, *this); Modified: trunk/jazz/src/Audio.h =================================================================== --- trunk/jazz/src/Audio.h 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/Audio.h 2010-07-12 01:21:59 UTC (rev 790) @@ -29,29 +29,30 @@ #include <wx/app.h> #include <wx/string.h> -class tEventArray; +class JZSamplesDialog; class JZTrack; -struct tAudioBuffer; class tAudioBufferQueue; class tAudioRecordBuffer; -class tSampleWin; +class tEventArray; class tSample; class tSampleVoice; +class tSampleWin; +struct tAudioBuffer; -// these should be variables and queried from the driver! +// These should be variables and queried from the driver! // -// there is still a bug somewhere: +// There is still a bug somewhere: // FRAGBITS 13 // BUFCOUNT 64 -// midi-speed 114 (trackwin) -// does not work, sounds like it skips a buffer after 18 bars +// MIDI-speed 114 (trackwin) +// Does not work, sounds like it skips a buffer after 18 bars. // // 1MB of buffer data seems to be reasonable. #ifdef __WXMSW__ -// mswin has big buffers, good! +// Microsoft Windows has big buffers. #define FRAGBITS 14 #define FRAGBYTES (1 << FRAGBITS) // # bytes @@ -62,8 +63,8 @@ #else -// linux only has 64K buffers and wastes one fragment. So keep -// fragments small +// Linux only has 64K buffers and wastes one fragment, so keep the fragments +// small. #define FRAGBITS 13 #define FRAGBYTES (1 << FRAGBITS) // # bytes @@ -72,17 +73,14 @@ #define BUFBYTES FRAGBYTES #define BUFCOUNT 128 // # buffers -#endif +#define WAVEHDR char - -// ============================================================= -// AudioBuffers -// ============================================================= - -#ifndef __WXMSW__ -#define WAVEHDR char #endif +//***************************************************************************** +// Description: +// This is the audio buffer structure declaration. +//***************************************************************************** struct tAudioBuffer { // This is a Microsoft Windows for mswin wavehdr @@ -118,7 +116,8 @@ DECLARE_ARRAY(tAudioBufferArray, tAudioBuffer*) - +//***************************************************************************** +//***************************************************************************** class tAudioBufferQueue { public: @@ -177,8 +176,8 @@ int read, written; }; - - +//***************************************************************************** +//***************************************************************************** class tAudioRecordBuffer { friend class tSampleSet; @@ -215,13 +214,10 @@ }; -// ============================================================= -// tSampleSet -// ============================================================= - -class JZSamplesDialog; - //***************************************************************************** +// Description: +// This is the sample set class declaration. This class holds a collection +// of audio samples that are played when a particular MIDI signal is received. //***************************************************************************** class tSampleSet { @@ -229,7 +225,6 @@ friend class tSampleVoice; friend class tSample; - friend class tAudioGloblForm; friend class JZWindowsAudioPlayer; friend class tAudioPlayer; friend class tAlsaAudioPlayer; @@ -256,26 +251,26 @@ void Edit(int key); - int GetSpeed() const + int GetSamplingRate() const { - return speed; + return mSamplingRate; } - void SetSpeed(int x) + void SetSamplingRate(int SamplingRate) { - dirty |= (speed != x); - speed = x; + dirty |= (mSamplingRate != SamplingRate); + mSamplingRate = SamplingRate; } - int GetChannels() const + int GetChannelCount() const { - return channels; + return mChannelCount; } - void SetChannels(int x) + void SetChannelCount(int ChannelCount) { - dirty |= (channels != x); - channels = x; + dirty |= (mChannelCount != ChannelCount); + mChannelCount = ChannelCount; } int BitsPerSample() const @@ -309,16 +304,18 @@ long Ticks2Samples(long ticks) const { - long spl = - (long)(60.0 * ticks * speed * channels / (double)ticks_per_minute); + long spl = (long)( + 60.0 * ticks * mSamplingRate * mChannelCount / + (double)ticks_per_minute); // Align to the first channel. - return spl & -channels; + return spl & -mChannelCount; } double Samples2Ticks(long samples) const { - return (double)samples * ticks_per_minute / 60.0 / speed / channels; + return (double) + samples * ticks_per_minute / 60.0 / mSamplingRate / mChannelCount; } // time in millisec @@ -334,12 +331,12 @@ long Samples2Time(long samples) const { - return (long)(1000.0 * samples / speed / channels); + return (long)(1000.0 * samples / mSamplingRate / mChannelCount); } long Time2Samples(long time) const { - return (long)(0.001 * time * speed * channels); + return (long)(0.001 * time * mSamplingRate * mChannelCount); } virtual const std::string& GetSampleLabel(int Index); @@ -388,7 +385,7 @@ long SampleSize(long num_samples) { - return channels * (bits == 8 ? 1L : 2L) * num_samples; + return mChannelCount * (bits == 8 ? 1L : 2L) * num_samples; } long BufferClock(int i) const @@ -400,15 +397,19 @@ protected: - long speed; // samples / second - int channels; // mono = 1, stereo = 2 + // Sampling rate in samples per second or Hz. + int mSamplingRate; + + // mono = 1, stereo = 2 + int mChannelCount; + int bits; // must be 16! bool softsync; // enable software midi/audio sync tSample* mSamples[eSampleCount]; tSampleWin* mSampleWindows[eSampleCount]; - long ticks_per_minute; // midi speed for audio/midi sync + long ticks_per_minute; // MIDI sampling rate for audio/midi sync. double clocks_per_buffer; long start_clock; // when did play start @@ -424,7 +425,6 @@ // return the start clock for i-th free buffer long buffers_written; // for computing buffers clock - wxDialog* mpGlobalSettingsDialog; JZSamplesDialog* mpSampleDialog; tEventArray* events; Added: trunk/jazz/src/Dialogs/AudioSettingsDialog.cpp =================================================================== --- trunk/jazz/src/Dialogs/AudioSettingsDialog.cpp (rev 0) +++ trunk/jazz/src/Dialogs/AudioSettingsDialog.cpp 2010-07-12 01:21:59 UTC (rev 790) @@ -0,0 +1,89 @@ +#include "AudioSettingsDialog.h" + +#include "../Audio.h" + +#include <wx/button.h> +#include <wx/checkbox.h> +#include <wx/combobox.h> +#include <wx/sizer.h> +#include <wx/stattext.h> + +//***************************************************************************** +//***************************************************************************** +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +JZAudioSettingsDialog::JZAudioSettingsDialog( + wxWindow* pParent, + tSampleSet& SampleSet) + : wxDialog(pParent, wxID_ANY, wxString("Audio Settings")), + mSampleSet(SampleSet), + mpEnableAudioCheckBox(0), + mpSamplingRateComboBox(0), + mpStereoCheckBox(0), + mpSoftwareMidiAudioSyncCheckBox(0) +{ + mpEnableAudioCheckBox = new wxCheckBox(this, wxID_ANY, "Enable Audio"); + + wxArrayString SampleRates; + SampleRates.push_back("8000"); + SampleRates.push_back("11025"); + SampleRates.push_back("22050"); + SampleRates.push_back("44100"); + + mpSamplingRateComboBox = new wxComboBox( + this, + wxID_ANY, + "", + wxDefaultPosition, + wxDefaultSize, + SampleRates); + + mpStereoCheckBox = new wxCheckBox(this, wxID_ANY, "Stereo"); + + mpSoftwareMidiAudioSyncCheckBox = new wxCheckBox( + this, + wxID_ANY, + "Software MIDI/Audio Sync"); + + wxButton* pOkButton = new wxButton(this, wxID_OK, "&OK"); + wxButton* pCancelButton = new wxButton(this, wxID_CANCEL, "Cancel"); + wxButton* pHelpButton = new wxButton(this, wxID_HELP, "Help"); + pOkButton->SetDefault(); + + wxBoxSizer* pTopSizer = new wxBoxSizer(wxVERTICAL); + wxFlexGridSizer* pFlexGridSizer; + + pTopSizer->Add(mpEnableAudioCheckBox, 0, wxALIGN_CENTER | wxALL, 3); + + pFlexGridSizer = new wxFlexGridSizer(1, 2, 4, 2); + pFlexGridSizer->Add( + new wxStaticText(this, wxID_ANY, "Sample Rate"), + 0, + wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); + pFlexGridSizer->Add( + mpSamplingRateComboBox, + 0, + wxALIGN_CENTER_VERTICAL); + pTopSizer->Add(pFlexGridSizer, 0, wxALIGN_CENTER | wxALL, 3); + + pTopSizer->Add(mpStereoCheckBox, 0, wxALIGN_CENTER | wxALL, 3); + + pTopSizer->Add( + mpSoftwareMidiAudioSyncCheckBox, + 0, + wxALIGN_CENTER | wxALL, + 3); + + wxBoxSizer* pButtonSizer = new wxBoxSizer(wxHORIZONTAL); + pButtonSizer->Add(pOkButton, 0, wxALL, 5); + pButtonSizer->Add(pCancelButton, 0, wxALL, 5); + pButtonSizer->Add(pHelpButton, 0, wxALL, 5); + + pTopSizer->Add(pButtonSizer, 0, wxALIGN_CENTER | wxBOTTOM, 6); + + SetAutoLayout(true); + SetSizer(pTopSizer); + + pTopSizer->SetSizeHints(this); + pTopSizer->Fit(this); +} Property changes on: trunk/jazz/src/Dialogs/AudioSettingsDialog.cpp ___________________________________________________________________ Added: svn:eol-style + native Added: trunk/jazz/src/Dialogs/AudioSettingsDialog.h =================================================================== --- trunk/jazz/src/Dialogs/AudioSettingsDialog.h (rev 0) +++ trunk/jazz/src/Dialogs/AudioSettingsDialog.h 2010-07-12 01:21:59 UTC (rev 790) @@ -0,0 +1,48 @@ +//***************************************************************************** +// The JAZZ++ Midi Sequencer +// +// Copyright (C) 2010 Peter J. Stieber, all rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//***************************************************************************** + +#ifndef JZ_AUDIOSETTINGSDIALOG_H +#define JZ_AUDIOSETTINGSDIALOG_H + +#include <wx/dialog.h> + +class tSampleSet; +class wxCheckBox; +class wxComboBox; + +//***************************************************************************** +//***************************************************************************** +class JZAudioSettingsDialog : public wxDialog +{ + public: + + JZAudioSettingsDialog(wxWindow* pParent, tSampleSet& SampleSet); + + private: + + tSampleSet& mSampleSet; + + wxCheckBox* mpEnableAudioCheckBox; + wxComboBox* mpSamplingRateComboBox; + wxCheckBox* mpStereoCheckBox; + wxCheckBox* mpSoftwareMidiAudioSyncCheckBox; +}; + +#endif // !defined(JZ_AUDIOSETTINGSDIALOG_H) Property changes on: trunk/jazz/src/Dialogs/AudioSettingsDialog.h ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/Makefile.am 2010-07-12 01:21:59 UTC (rev 790) @@ -22,6 +22,7 @@ DeprecatedWx/prop.cpp \ DeprecatedWx/propform.cpp \ DeprecatedWx/proplist.cpp \ +Dialogs/AudioSettingsDialog.cpp \ Dialogs/CleanupDialog.cpp \ Dialogs/ControllerDialog.cpp \ Dialogs/DeleteDialog.cpp \ @@ -119,6 +120,7 @@ DeprecatedWx/prop.cpp \ DeprecatedWx/propform.cpp \ DeprecatedWx/proplist.cpp \ +Dialogs/AudioSettingsDialog.cpp \ Dialogs/CleanupDialog.cpp \ Dialogs/ControllerDialog.cpp \ Dialogs/DeleteDialog.cpp \ @@ -221,6 +223,7 @@ DeprecatedWx/propform.h \ DeprecatedWx/proplist.h \ DeprecatedStringUtils.h \ +Dialogs/AudioSettingsDialog.h \ Dialogs/CleanupDialog.h \ Dialogs/ControllerDialog.h \ Dialogs/DeleteDialog.h \ Modified: trunk/jazz/src/Player.h =================================================================== --- trunk/jazz/src/Player.h 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/Player.h 2010-07-12 01:21:59 UTC (rev 790) @@ -243,13 +243,16 @@ virtual void StartAudio() { } - virtual int GetAudioEnabled() const + + virtual bool GetAudioEnabled() const { - return 0; + return false; } - virtual void SetAudioEnabled(int) + + virtual void SetAudioEnabled(bool AudioEnabled) { } + virtual void ListenAudio(int key, int start_stop_mode = 1) { } Modified: trunk/jazz/src/Sample.cpp =================================================================== --- trunk/jazz/src/Sample.cpp 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/Sample.cpp 2010-07-12 01:21:59 UTC (rev 790) @@ -309,7 +309,7 @@ } // convert mono -> stereo - if (channels == 1 && set.channels == 2) + if (channels == 1 && set.GetChannelCount() == 2) { short *old = data; length = length * 2; @@ -325,7 +325,7 @@ channels = 2; } // convert stereo -> mono - else if (channels == 2 && set.channels == 1) + else if (channels == 2 && set.GetChannelCount() == 1) { short *old = data; length = length / 2; @@ -345,9 +345,9 @@ // convert sampling speed if (pitch != 0) speed = (int)(speed * pow(FSEMI, pitch)); - if (speed != set.speed) + if (speed != set.GetSamplingRate()) { - float f = (float)speed / (float)set.speed; + float f = (float)speed / (float)set.GetSamplingRate(); Transpose(f); } @@ -356,7 +356,7 @@ { int ch1 = volume; int ch2 = volume; - int ppan = (set.channels == 2) ? pan : 0; + int ppan = (set.GetChannelCount() == 2) ? pan : 0; if (ppan > 0) ch1 = (int)volume * (63L - ppan) / 64L; else if (ppan < 0) @@ -426,7 +426,7 @@ offs = 0; else if (offs > length) offs = length; - return offs & -(int)set.channels; + return offs & - set.GetChannelCount(); } @@ -528,7 +528,7 @@ void tSample::Flip(int ch) { int i = ch; - int step = set.GetChannels(); + int step = set.GetChannelCount(); while (i < length) { data[i] = -data[i]; @@ -553,13 +553,13 @@ int tSample::GetSamplingRate() const { - return set.GetSpeed(); + return set.GetSamplingRate(); } -int tSample::GetChannels() const +int tSample::GetChannelCount() const { - return set.GetChannels(); + return set.GetChannelCount(); } @@ -603,7 +603,7 @@ void tSample::Transpose(float f) { - int channels = set.GetChannels(); + int channels = set.GetChannelCount(); int new_length = ((int)((double)length / (double)f) & (-channels)); short *new_data = new short [new_length]; @@ -629,13 +629,23 @@ int tSample::Seconds2Samples(float time) { - JZMapper Map(0.0, 1.0, 0.0, (double)set.speed * set.channels); + JZMapper Map( + 0.0, + 1.0, + 0.0, + (double)set.GetSamplingRate() * set.GetChannelCount()); + return static_cast<int>(Map.XToY(time)); } float tSample::Samples2Seconds(int samples) { - JZMapper Map(0.0, (double)set.speed * set.channels, 0.0, 1.0); + JZMapper Map( + 0.0, + (double)set.GetSamplingRate() * set.GetChannelCount(), + 0.0, + 1.0); + return (float)Map.XToY(samples); } @@ -683,19 +693,19 @@ int tSample::SaveWave() { WaveHeader wh; - wh.main_chunk = RIFF; - wh.chunk_type = WAVE; - wh.sub_chunk = FMT; - wh.data_chunk = DATA; - wh.format = PCM_CODE; - wh.modus = set.channels; - wh.sc_len = 16; - wh.sample_fq = set.speed; - wh.bit_p_spl = set.bits; - wh.byte_p_spl = set.channels * (set.bits > 8 ? 2 : 1); - wh.byte_p_sec = wh.byte_p_spl * wh.sample_fq; - wh.data_length = length * sizeof(short); - wh.length = wh.data_length + sizeof(WaveHeader); + wh.main_chunk = RIFF; + wh.chunk_type = WAVE; + wh.sub_chunk = FMT; + wh.data_chunk = DATA; + wh.format = PCM_CODE; + wh.modus = set.GetChannelCount(); + wh.sc_len = 16; + wh.sample_fq = set.GetSamplingRate(); + wh.bit_p_spl = set.bits; + wh.byte_p_spl = set.GetChannelCount() * (set.bits > 8 ? 2 : 1); + wh.byte_p_sec = wh.byte_p_spl * wh.sample_fq; + wh.data_length = length * sizeof(short); + wh.length = wh.data_length + sizeof(WaveHeader); #ifdef __WXMSW__ unlink(mFileName.c_str()); // buggy, sigh! @@ -719,8 +729,8 @@ data = new float [length]; for (int i = 0; i < length; i++) data[i] = (float)spl.data[i]; - channels = spl->GetChannels(); - sampling_rate = spl->GetSpeed(); + channels = spl->GetChannelCount(); + sampling_rate = spl->GetSamplingRate(); } tFloatSample::tFloatSample(tSample &spl, int fr, int to) @@ -730,8 +740,8 @@ data = new float [length]; for (int i = 0; i < length; i++) data[i] = (float)spl.data[i + fr]; - channels = spl->GetChannels(); - sampling_rate = spl->GetSpeed(); + channels = spl->GetChannelCount(); + sampling_rate = spl->GetSamplingRate(); } tFloatSample::tFloatSample(int ch, int sr) Modified: trunk/jazz/src/Sample.h =================================================================== --- trunk/jazz/src/Sample.h 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/Sample.h 2010-07-12 01:21:59 UTC (rev 790) @@ -153,7 +153,7 @@ void AssureLength(int new_length); - int GetChannels() const + int GetChannelCount() const { return channels; } @@ -195,9 +195,9 @@ * data[n+1] == 2nd value for left channel * ... * all length values mean number of shorts and - * should be multiples of of set.GetChannels(). + * should be multiples of of set.GetChannelCount(). * Offsets should start on channel boundaries, - * that is offs % set.GetChannels() == 0. + * that is offs % set.GetChannelCount() == 0. */ class tSample @@ -315,7 +315,8 @@ return &set; } - int GetChannels() const; + int GetChannelCount() const; + int GetSamplingRate() const; /** Modified: trunk/jazz/src/SampleCommand.cpp =================================================================== --- trunk/jazz/src/SampleCommand.cpp 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/SampleCommand.cpp 2010-07-12 01:21:59 UTC (rev 790) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -100,7 +100,7 @@ if (n <= 0) return; // no data - long channels = spl.GetChannels(); + long channels = spl.GetChannelCount(); float N = spl.length / channels - 2; short *data = spl.data; @@ -238,7 +238,7 @@ void tWahWah::Execute(long fr, long to) { tFloatSample *out = new tFloatSample(spl); - for (int c = 0; c < out->GetChannels(); c++) + for (int c = 0; c < out->GetChannelCount(); c++) Wah(c, *out); out->Rescale(); spl.Set(*out); @@ -251,7 +251,7 @@ { long N = spl.GetLength(); float SR = spl.GetSamplingRate(); - long channels = spl.GetChannels(); + long channels = spl.GetChannelCount(); JZMapper XMap(0, N, 0, arr.Size()); JZMapper fmap(0, 100, lo_freq, hi_freq); @@ -297,7 +297,7 @@ { JZMapper wmap(0, 100, 0.05, 0.3); tFloatSample inp(spl); - tFloatSample out(inp.GetChannels(), inp.GetSamplingRate()); + tFloatSample out(inp.GetChannelCount(), inp.GetSamplingRate()); float p[8]; p[0] = 0; p[1] = 0; @@ -308,7 +308,7 @@ p[6] = 0; p[7] = 0; rotate(p, 8, inp, out); - if (inp.GetChannels() == 2) + if (inp.GetChannelCount() == 2) { p[6] = 1; p[7] = 1; @@ -337,7 +337,7 @@ { JZMapper wmap(0, 100, 0.05, 0.3); tFloatSample inp(spl); - tFloatSample out(inp.GetChannels(), inp.GetSamplingRate()); + tFloatSample out(inp.GetChannelCount(), inp.GetSamplingRate()); float p[8]; p[0] = 0; p[1] = 0; @@ -348,7 +348,7 @@ p[6] = 0; p[7] = 0; rotate(p, 8, inp, out); - if (inp.GetChannels() == 2) + if (inp.GetChannelCount() == 2) { p[6] = 1; p[7] = 1; @@ -403,7 +403,7 @@ reinit = (int)(p[5] * SR); off = reinit/2; k = off; - chans = sout.GetChannels(); + chans = sout.GetChannelCount(); inchan = (int)p[6]; j = 0; for (i = 0; i < nsamps; i++) Modified: trunk/jazz/src/SampleDialog.cpp =================================================================== --- trunk/jazz/src/SampleDialog.cpp 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/SampleDialog.cpp 2010-07-12 01:21:59 UTC (rev 790) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -111,7 +111,7 @@ spl(w.GetSample()) { int i; - channels = spl.GetChannels(); + channels = spl.GetChannelCount(); for (i = 0; i < array.Size(); ++i) { array[i] = 0; @@ -172,7 +172,7 @@ float oldpeak = fs.Peak(); int i = 0; - int channels = fs.GetChannels(); + int channels = fs.GetChannelCount(); int n = to - fr; float *data = fs.GetData(); @@ -991,7 +991,7 @@ float peak = fs.Peak(); if (rand) { - if (fs.GetChannels() == 2) + if (fs.GetChannelCount() == 2) fs.RndEchoStereo(num_echos, dmap(delay), (float)amap(ampl)); else fs.RndEcho(num_echos, dmap(delay), (float)amap(ampl)); @@ -1073,7 +1073,7 @@ { JZMapper wmap(0, 100, 0.05, 0.3); tFloatSample inp(spl); - tFloatSample out(inp.GetChannels(), inp.GetSamplingRate()); + tFloatSample out(inp.GetChannelCount(), inp.GetSamplingRate()); //float peak = inp.Peak(); tShifterCmd shifter(inp, out); @@ -1088,7 +1088,7 @@ p[6] = 0; p[7] = 0; shifter.rotate(p, 8); - if (inp.GetChannels() == 2) + if (inp.GetChannelCount() == 2) { p[6] = 1; p[7] = 1; Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/SampleWindow.cpp 2010-07-12 01:21:59 UTC (rev 790) @@ -317,7 +317,7 @@ { int cw, ch; GetClientSize(&cw, &ch); -// snapsel.SetYSnap(0, ch, ch / spl.GetChannels()); +// snapsel.SetYSnap(0, ch, ch / spl.GetChannelCount()); snapsel.SetYSnap(0, ch, ch); AdjustScrollbars(); @@ -467,7 +467,7 @@ int cw, ch; GetClientSize(&cw, &ch); - int n = spl.GetChannels(); + int n = spl.GetChannelCount(); for (int i = 0; i < n; ++i) { int x = 0; @@ -579,7 +579,7 @@ { const short* data = spl.GetData(); int length = spl.GetLength(); - int step = spl.GetChannels(); + int step = spl.GetChannelCount(); // compute display range from position scrollbar int xfr = paint_offset + channel; @@ -887,15 +887,15 @@ int yy = ToolBarSize.GetHeight(); int ww = cw; int hh = ch - ToolBarSize.GetHeight() - zh - ph; - int nn = spl.GetChannels() + num_params; + int nn = spl.GetChannelCount() + num_params; - int hi = hh * spl.GetChannels() / nn; + int hi = hh * spl.GetChannelCount() / nn; cnvs->SetSize(xx, yy, ww, hi); hi = hh / nn; for (int i = 0; i < num_params; i++) { - int yi = yy + (i + spl.GetChannels()) * hh / nn; + int yi = yy + (i + spl.GetChannelCount()) * hh / nn; params[i]->SetSize(xx, yi, ww, hi); } } Modified: trunk/jazz/src/Signal2.cpp =================================================================== --- trunk/jazz/src/Signal2.cpp 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/Signal2.cpp 2010-07-12 01:21:59 UTC (rev 790) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -77,7 +77,7 @@ float room_val) // echo delay { long sr = spl.GetSamplingRate(); - long ch = spl.GetChannels(); + long ch = spl.GetChannelCount(); tSigSynth synth(sr, ch); tShortIter isig(synth, spl); @@ -115,7 +115,7 @@ float volume) // 0..1 { long sr = spl.GetSamplingRate(); - long ch = spl.GetChannels(); + long ch = spl.GetChannelCount(); tSigSynth synth(sr, ch); tShortIter isig(synth, spl); @@ -200,7 +200,7 @@ ) { long sr = spl.GetSamplingRate(); - long ch = spl.GetChannels(); + long ch = spl.GetChannelCount(); tSigSynth synth(sr, ch); FreqTab ft; double freq = ft.freq(midi_key); Modified: trunk/jazz/src/Signal2.h =================================================================== --- trunk/jazz/src/Signal2.h 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/Signal2.h 2010-07-12 01:21:59 UTC (rev 790) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -314,7 +314,7 @@ generators.push_back(&gen); } - int GetChannels() const + int GetChannelCount() const { return channels; } @@ -349,7 +349,7 @@ tSigInput(tSigSynth &parent) : synth(parent) { synth.AddGenerator(*this); - channels = synth.GetChannels(); + channels = synth.GetChannelCount(); sampling_rate = synth.GetSamplingRate(); current = -1; } @@ -506,8 +506,8 @@ { Resize(this->GetLength() * 2); } - long idata = this->GetCurrent() * this->GetChannels(); - for (int i = 0; i < this->GetChannels(); i++) + long idata = this->GetCurrent() * this->GetChannelCount(); + for (int i = 0; i < this->GetChannelCount(); i++) { this->data[idata++] = (T)v[i]; } @@ -599,7 +599,7 @@ public: tSigWaveOscil(tSigSynth &synth, int N, double f, double ffact = FSEMI) : tSignalModifier(synth), - array(N, synth.GetChannels()), + array(N, synth.GetChannelCount()), freq(f), SR(synth.GetSamplingRate()), frqfact(ffact) @@ -659,7 +659,7 @@ public: tSigWaveCtrl(tSigSynth &synth, int N, double durat) : tSigInput(synth), - array(N, synth.GetChannels()), + array(N, synth.GetChannelCount()), xmap(0, synth.GetSamplingRate() * durat, 0, N) { } @@ -806,7 +806,7 @@ tSigDelay(tSigSynth &synth, float time) : tSignalModifier(synth), size((long)(time * sampling_rate) + 2), - array(size, synth.GetChannels()) + array(size, synth.GetChannelCount()) { map.Initialize(-1, 1, 0, -size+1); } @@ -1045,7 +1045,7 @@ tSigComb(tSigSynth &synth, float loop_time, float reverb_time) : tSignalModifier(synth), size((long)(loop_time * synth.GetSamplingRate())), - array(size+2, synth.GetChannels()) + array(size+2, synth.GetChannelCount()) { coeff = exp((double)(log001 * loop_time / reverb_time)); } Modified: trunk/jazz/src/mswin/WindowsAudioInterface.cpp =================================================================== --- trunk/jazz/src/mswin/WindowsAudioInterface.cpp 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/mswin/WindowsAudioInterface.cpp 2010-07-12 01:21:59 UTC (rev 790) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -63,7 +63,7 @@ // Indicate that we are not recording! mpPlayer->mpRecordingInfo = 0; - mChannels = mpPlayer->mSamples.GetChannels(); + mChannels = mpPlayer->mSamples.GetChannelCount(); mCount = mpPlayer->mSamples.PrepareListen(key); @@ -90,7 +90,7 @@ // Indicate that we are not recording! mpPlayer->mpRecordingInfo = 0; - mChannels = mpPlayer->mSamples.GetChannels(); + mChannels = mpPlayer->mSamples.GetChannelCount(); mCount = mpPlayer->mSamples.PrepareListen(&spl, fr_smpl, to_smpl); @@ -150,17 +150,20 @@ mErrorCode(NoError), mCanDuplex(false), mCanSynchronize(true), + mInstalled(false), + mAudioEnabled(false), + blocks_played(0), + play_buffers_needed(0), + start_clock(0), + start_time(0), mpListener(0) { mpState->audio_player = this; InitializeCriticalSection(&mutex); - long dummy = 0; mpAudioBuffer = new tEventArray(); - mInstalled = false; - dummy = gpConfig->GetValue(C_EnableAudio); - audio_enabled = dummy; + mAudioEnabled = (gpConfig->GetValue(C_EnableAudio) != 0); hout_open = 0; hinp_open = 0; @@ -193,7 +196,7 @@ } } recbuffers.Clear(); - audio_enabled = (audio_enabled && mInstalled); + mAudioEnabled = (mAudioEnabled && mInstalled); } //----------------------------------------------------------------------------- @@ -264,7 +267,7 @@ mErrorCode = NoError; // everything ok for now. - if (!audio_enabled) + if (!mAudioEnabled) { return 0; } @@ -275,9 +278,9 @@ WAVEFORMATEX fmt; memset(&fmt, 0, sizeof(fmt)); fmt.wFormatTag = WAVE_FORMAT_PCM; - fmt.nChannels = mSamples.GetChannels(); - fmt.nSamplesPerSec = mSamples.GetSpeed(); - fmt.nBlockAlign = mSamples.GetChannels() * sizeof(short); + fmt.nChannels = mSamples.GetChannelCount(); + fmt.nSamplesPerSec = mSamples.GetSamplingRate(); + fmt.nBlockAlign = mSamples.GetChannelCount() * sizeof(short); fmt.nAvgBytesPerSec = fmt.nBlockAlign * fmt.nSamplesPerSec; fmt.wBitsPerSample = 16; fmt.cbSize = 0; @@ -490,7 +493,7 @@ //----------------------------------------------------------------------------- void JZWindowsAudioPlayer::WriteBuffers() { - if (audio_enabled && hout_open) + if (mAudioEnabled && hout_open) { tAudioBuffer* pAudioBuffer; while ((pAudioBuffer = mSamples.full_buffers.Get()) != 0) @@ -517,7 +520,7 @@ //----------------------------------------------------------------------------- void JZWindowsAudioPlayer::Notify() { - if (audio_enabled) + if (mAudioEnabled) { EnterCriticalSection(&mutex); @@ -539,8 +542,9 @@ if (res == MMSYSERR_NOERROR && mmtime.wType == TIME_SAMPLES) { long time_now = (long)timeGetTime(); - long audio_now = - (long)((double)start_time + 1000.0 * mmtime.u.sample / mSamples.speed); + long audio_now = (long)( + (double)start_time + 1000.0 * mmtime.u.sample / + mSamples.GetSamplingRate()); // low pass filter for time-correction (not really necessary) const long low = 50; @@ -588,9 +592,11 @@ if (res == MMSYSERR_NOERROR && mmtime.wType == TIME_SAMPLES) { long time_now = (long)timeGetTime(); - long audio_now = - (long)((double)mpState->start_time + 1000.0 * mmtime.u.sample / mSamples.speed); - // low pass filter for time-correction (not really necessary) + long audio_now = (long)( + (double)mpState->start_time + 1000.0 * mmtime.u.sample / + mSamples.GetSamplingRate()); + + // Low pass filter for time-correction (not really necessary). const long low = 50; mpState->time_correction = (low * mpState->time_correction + (100 - low) * (audio_now - time_now) ) / 100L; } @@ -598,7 +604,7 @@ } LeaveCriticalSection(&mutex); - } // if (audio_enabled) + } // if (mAudioEnabled) JZWindowsIntPlayer::Notify(); } @@ -610,7 +616,7 @@ mSamples.StartPlay(Clock); JZWindowsIntPlayer::StartPlay(Clock, LoopClock, Continue); - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -655,7 +661,7 @@ //----------------------------------------------------------------------------- void JZWindowsAudioPlayer::ListenAudio(int key, int start_stop_mode) { - if (!audio_enabled) + if (!mAudioEnabled) { return; } @@ -684,9 +690,12 @@ //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- -void JZWindowsAudioPlayer::ListenAudio(tSample &spl, long fr_smpl, long to_smpl) +void JZWindowsAudioPlayer::ListenAudio( + tSample &spl, + long fr_smpl, + long to_smpl) { - if (!audio_enabled) + if (!mAudioEnabled) { return; } Modified: trunk/jazz/src/mswin/WindowsAudioInterface.h =================================================================== --- trunk/jazz/src/mswin/WindowsAudioInterface.h 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/src/mswin/WindowsAudioInterface.h 2010-07-12 01:21:59 UTC (rev 790) @@ -3,7 +3,7 @@ // // Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all rights reserved. // Modifications Copyright (C) 2004 Patrick Earl -// Modifications Copyright (C) 2008 Peter J. Stieber +// Modifications Copyright (C) 2008-2010 Peter J. Stieber // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -71,14 +71,14 @@ return mInstalled && JZWindowsIntPlayer::IsInstalled(); } - virtual int GetAudioEnabled() const + virtual bool GetAudioEnabled() const { - return audio_enabled; + return mAudioEnabled; } - virtual void SetAudioEnabled(int x) + virtual void SetAudioEnabled(bool AudioEnabled) { - audio_enabled = x; + mAudioEnabled = AudioEnabled; } virtual void ListenAudio(int key, int start_stop_mode = 1); @@ -123,6 +123,11 @@ void AudioCallback(UINT msg); + int OpenDsp(); // 0 = ok + int CloseDsp(); // 0 = ok + + private: + TEErrorCode mErrorCode; // Indicates if full duplex record/play is possible. @@ -131,11 +136,11 @@ // Indicates if the exact output play position can be determined. bool mCanSynchronize; - int OpenDsp(); // 0 = ok - int CloseDsp(); // 0 = ok + bool mInstalled; - bool mInstalled; - int audio_enabled; // 0 means midi only + // A value of false means MIDI only. + bool mAudioEnabled; + long blocks_played; // # of blocks written to device int play_buffers_needed; // driver requests more output buffers Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-07-11 21:45:22 UTC (rev 789) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-07-12 01:21:59 UTC (rev 790) @@ -1129,6 +1129,14 @@ Name="Dialog Source Files" > <File + RelativePath="..\src\Dialogs\AudioSettingsDialog.cpp" + > + </File> + <File + RelativePath="..\src\Dialogs\AudioSettingsDialog.h" + > + </File> + <File RelativePath="..\src\Dialogs\CleanupDialog.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2010-07-17 21:15:06
|
Revision: 810 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=810&view=rev Author: pstieber Date: 2010-07-17 21:15:00 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Separated the sample frame class into its own source and header files. Modified Paths: -------------- trunk/jazz/src/Audio.cpp trunk/jazz/src/Makefile.am trunk/jazz/src/SampleDialog.cpp trunk/jazz/src/SampleWindow.cpp trunk/jazz/src/SampleWindow.h trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj Modified: trunk/jazz/src/Audio.cpp =================================================================== --- trunk/jazz/src/Audio.cpp 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/src/Audio.cpp 2010-07-17 21:15:00 UTC (rev 810) @@ -34,7 +34,7 @@ #include "RecordingInfo.h" #include "Resources.h" #include "Sample.h" -#include "SampleWindow.h" +#include "SampleFrame.h" #include "StringReadWrite.h" #include "Track.h" #include "TrackFrame.h" Modified: trunk/jazz/src/Makefile.am =================================================================== --- trunk/jazz/src/Makefile.am 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/src/Makefile.am 2010-07-17 21:15:00 UTC (rev 810) @@ -89,9 +89,10 @@ RecordingInfo.cpp \ Rectangle.cpp \ Rhythm.cpp \ +Sample.cpp \ SampleCommand.cpp \ -Sample.cpp \ SampleDialog.cpp \ +SampleFrame.cpp \ SampleWindow.cpp \ SelectControllerDialog.cpp \ Signal2.cpp \ @@ -188,9 +189,10 @@ RecordingInfo.cpp \ Rectangle.cpp \ Rhythm.cpp \ +Sample.cpp \ SampleCommand.cpp \ -Sample.cpp \ SampleDialog.cpp \ +SampleFrame.cpp \ SampleWindow.cpp \ SelectControllerDialog.cpp \ Signal2.cpp \ @@ -292,9 +294,10 @@ Rectangle.h \ Resources.h \ Rhythm.h \ +Sample.h \ SampleCommand.h \ SampleDialog.h \ -Sample.h \ +SampleFrame.h \ SampleWindow.h \ SelectControllerDialog.h \ Signal2.h \ Modified: trunk/jazz/src/SampleDialog.cpp =================================================================== --- trunk/jazz/src/SampleDialog.cpp 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/src/SampleDialog.cpp 2010-07-17 21:15:00 UTC (rev 810) @@ -23,7 +23,7 @@ #include "SampleDialog.h" #include "Sample.h" -#include "SampleWindow.h" +#include "SampleFrame.h" #include "Mapper.h" #include "Audio.h" #include "SignalInterface.h" @@ -44,8 +44,10 @@ using namespace std; -JZCommandPainter::JZCommandPainter(JZSampleFrame &w, JZPaintableCommand &c) - : win(w), +JZCommandPainter::JZCommandPainter( + JZSampleFrame& SampleFrame, + JZPaintableCommand &c) + : win(SampleFrame), cmd(c) { c.Initialize(); @@ -104,11 +106,11 @@ int JZEqualizer::geo[4] = { 50, 80, 350, 200 }; -JZEqualizer::JZEqualizer(JZSampleFrame &w) - : JZSliderWindow(&w, "Equalizer", geo), +JZEqualizer::JZEqualizer(JZSampleFrame& SampleFrame) + : JZSliderWindow(&SampleFrame, "Equalizer", geo), array(12, -100, 100), - win(w), - spl(w.GetSample()) + win(SampleFrame), + spl(SampleFrame.GetSample()) { int i; channels = spl.GetChannelCount(); @@ -215,10 +217,10 @@ int JZDistortion::geo[4] = { 50, 80, 300, 320 }; -JZDistortion::JZDistortion(JZSampleFrame &w) -: JZSliderWindow(&w, "Distortion", geo), - arr(200, 0, 100), - win(w) +JZDistortion::JZDistortion(JZSampleFrame& SampleFrame) + : JZSliderWindow(&SampleFrame, "Distortion", geo), + arr(200, 0, 100), + win(SampleFrame) { N = 200; ymin = 0; @@ -320,7 +322,9 @@ { int fr, to; if (!win.HaveSelection(fr, to)) + { return; + } wxBeginBusyCursor(); JZSample &spl = win.GetSample(); @@ -491,9 +495,9 @@ }; -JZSynthDlg::JZSynthDlg(JZSampleFrame &w) -: JZSliderWindow(&w, "Additive Synthesis", geo, syn_tdefs), - win(w) +JZSynthDlg::JZSynthDlg(JZSampleFrame& SampleFrame) +: JZSliderWindow(&SampleFrame, "Additive Synthesis", geo, syn_tdefs), + win(SampleFrame) { Initialize(); default_filename = copystring("noname.syn"); @@ -902,9 +906,9 @@ int JZReverbForm::volume = 20; // effect volume int JZReverbForm::rvbtime = 30; // echo absorbtion -JZReverbForm::JZReverbForm(JZSampleFrame &w) +JZReverbForm::JZReverbForm(JZSampleFrame& SampleFrame) : wxForm( USED_WXFORM_BUTTONS ), - win(w) + win(SampleFrame) { } @@ -974,9 +978,9 @@ bool JZEchoForm::rand = false; -JZEchoForm::JZEchoForm(JZSampleFrame &w) -: wxForm( USED_WXFORM_BUTTONS ), - win(w) +JZEchoForm::JZEchoForm(JZSampleFrame& SampleFrame) + : wxForm(USED_WXFORM_BUTTONS), + win(SampleFrame) { wxForm::OnCancel(); } @@ -1019,9 +1023,9 @@ bool JZShifterForm::keep_length = 1; -JZShifterForm::JZShifterForm(JZSampleFrame &w) -: wxForm( USED_WXFORM_BUTTONS ), - win(w) +JZShifterForm::JZShifterForm(JZSampleFrame& SampleFrame) + : wxForm( USED_WXFORM_BUTTONS ), + win(SampleFrame) { } @@ -1119,12 +1123,19 @@ int JZSplFilterForm::lo_freq = 400; int JZSplFilterForm::hi_freq = 2000; int JZSplFilterForm::band_width = 20; // in % of corner freq -static const char *filter_types[] = { "Low Pass", "High Pass", "Band Pass", "Band Stop", 0 }; +static const char *filter_types[] = +{ + "Low Pass", + "High Pass", + "Band Pass", + "Band Stop", + 0 +}; -JZSplFilterForm::JZSplFilterForm(JZSampleFrame &w, bool p) -: wxForm( USED_WXFORM_BUTTONS ), - win(w) +JZSplFilterForm::JZSplFilterForm(JZSampleFrame& SampleFrame, bool p) + : wxForm( USED_WXFORM_BUTTONS ), + win(SampleFrame) { painter = p; } @@ -1231,9 +1242,11 @@ // filter painter settings // ------------------------------------------------------------------------- -JZWahSettingsForm::JZWahSettingsForm(JZSampleFrame &win, JZWahWah &w) - : JZSplFilterForm(win, true), - wah(w) +JZWahSettingsForm::JZWahSettingsForm( + JZSampleFrame& SampleFrame, + JZWahWah& WahWah) + : JZSplFilterForm(SampleFrame, true), + wah(WahWah) { type = (int)wah.filter_type; } @@ -1260,10 +1273,10 @@ int JZSplPitchForm::range = 1; -JZSplPitchForm::JZSplPitchForm(JZSampleFrame &w, JZSplPitch &p) -: wxForm( USED_WXFORM_BUTTONS ), - win(w), - pitch(p) +JZSplPitchForm::JZSplPitchForm(JZSampleFrame& SampleFrame, JZSplPitch& p) + : wxForm(USED_WXFORM_BUTTONS), + win(SampleFrame), + pitch(p) { } @@ -1302,9 +1315,9 @@ int JZChorusForm::pan_spread = 50; int JZChorusForm::volume = 50; -JZChorusForm::JZChorusForm(JZSampleFrame &w) -: wxForm( USED_WXFORM_BUTTONS ), - win(w) +JZChorusForm::JZChorusForm(JZSampleFrame& SampleFrame) + : wxForm( USED_WXFORM_BUTTONS ), + win(SampleFrame) { } @@ -1383,9 +1396,9 @@ int JZStereoForm::delay = 10; // millisec int JZStereoForm::stereo_spread = 50; -JZStereoForm::JZStereoForm(JZSampleFrame &w) -: wxForm( USED_WXFORM_BUTTONS ), - win(w) +JZStereoForm::JZStereoForm(JZSampleFrame& SampleFrame) + : wxForm(USED_WXFORM_BUTTONS), + win(SampleFrame) { } @@ -1444,10 +1457,10 @@ bool JZStretcherForm::keep_pitch = 1; -JZStretcherForm::JZStretcherForm(JZSampleFrame &w) -: wxForm( USED_WXFORM_BUTTONS ), - win(w), - spl(w.GetSample()) +JZStretcherForm::JZStretcherForm(JZSampleFrame& SampleFrame) + : wxForm( USED_WXFORM_BUTTONS ), + win(SampleFrame), + spl(SampleFrame.GetSample()) { } Modified: trunk/jazz/src/SampleWindow.cpp =================================================================== --- trunk/jazz/src/SampleWindow.cpp 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/src/SampleWindow.cpp 2010-07-17 21:15:00 UTC (rev 810) @@ -22,161 +22,91 @@ #include "SampleWindow.h" -#include "Audio.h" -#include "FileSelector.h" -#include "Globals.h" -#include "Help.h" #include "Mapper.h" -#include "MouseAction.h" #include "Player.h" -#include "Resources.h" -#include "Rhythm.h" -#include "Sample.h" -#include "SampleCommand.h" -#include "SampleDialog.h" -#include "Song.h" -#include "SliderWindow.h" -#include "ToolBar.h" +#include "SampleFrame.h" #include <wx/dcclient.h> -#include <wx/menu.h> -#include <wx/msgdlg.h> -#include <wx/scrolbar.h> -//DEBUG#include <iostream> - -#define MEN_HELP 5 - -#define MEN_SILENCE 21 -#define MEN_SILENCE_INS 22 -#define MEN_SILENCE_APP 23 -#define MEN_SILENCE_OVR 24 - -#define MEN_ACCEPT 42 - -#define MEN_FLIP 56 -#define MEN_FLIP_LEFT 57 -#define MEN_FLIP_RIGHT 58 - -class JZSamplePlayPosition; - //***************************************************************************** //***************************************************************************** -class JZInsertionPoint +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZInsertionPoint::Draw(int x) { - public: + last_x = x; + visible ^= 1; + wxDC *dc = new wxClientDC(mpScrolledWindow); + int cw, ch; + mpScrolledWindow->GetClientSize(&cw, &ch); + dc->SetPen(*wxRED_PEN); + dc->SetLogicalFunction(wxXOR); + dc->DrawLine(x, 0, x, ch); + dc->SetPen(*wxBLACK_PEN); + dc->SetLogicalFunction(wxCOPY); +} - JZInsertionPoint(wxScrolledWindow* pScrolledWindow) - : mpScrolledWindow(pScrolledWindow) - { - last_x = 0; - visible = 0; - } - - void Draw(int x) - { - last_x = x; - visible ^= 1; - wxDC *dc = new wxClientDC(mpScrolledWindow); - int cw, ch; - mpScrolledWindow->GetClientSize(&cw, &ch); - dc->SetPen(*wxRED_PEN); - dc->SetLogicalFunction(wxXOR); - dc->DrawLine(x, 0, x, ch); - dc->SetPen(*wxBLACK_PEN); - dc->SetLogicalFunction(wxCOPY); - } - - void Draw() - { - Draw(last_x); - } - - int IsVisible() const - { - return visible; - } - - float GetX() const - { - return last_x; - } - - private: - - int last_x; - int visible; - wxScrolledWindow* mpScrolledWindow; -}; - //***************************************************************************** //***************************************************************************** -class JZSampleWindow : public wxScrolledWindow +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSamplePlayPosition::StopListen() { - friend class JZSampleFrame; - friend class JZSmplWinSettingsForm; + Stop(); + if (gpMidiPlayer->IsListening()) + gpMidiPlayer->ListenAudio(-1); + if (visible) + Draw(); +} - public: +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSamplePlayPosition::StartListen(int fr, int to) +{ + fr_smpl = fr; + to_smpl = to; + gpMidiPlayer->ListenAudio(spl, fr_smpl, to_smpl); + Start(100); +} - JZSampleWindow(JZSampleFrame* pSampleFrame, JZSample& Sample); +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +bool JZSamplePlayPosition::IsListening() const +{ + return gpMidiPlayer->IsListening(); +} - virtual ~JZSampleWindow(); +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSamplePlayPosition::Draw() +{ + visible ^= 1; + wxDC *dc = new wxClientDC(&cnvs); + int cw, ch; + cnvs.GetClientSize(&cw, &ch); + dc->SetPen(*wxGREEN_PEN); + dc->SetLogicalFunction(wxXOR); + dc->DrawLine(x, 0, x, ch); + dc->SetPen(*wxBLACK_PEN); + dc->SetLogicalFunction(wxCOPY); +} - void Redraw() - { - OnPaint(); - } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void JZSamplePlayPosition::Notify() +{ + int pos = mpPlayer->GetListenerPlayPosition(); + if (pos < 0) + { + StopListen(); + return; + } + if (visible) + Draw(); + x = cnvs.Sample2Pixel(fr_smpl + pos); + Draw(); +} - virtual void OnPaint(); - - virtual void OnSize(int w, int h); - - virtual void OnEvent(wxMouseEvent& MouseEvent); - - void ClearSelection(); - - void SetInsertionPoint(int offs); - - void SetSelection(int fr, int to); - - int Sample2Pixel(int sample); - - int Pixel2Sample(float pixel); - - void Play(); - - private: - - void DrawSample(int channel, int x, int y, int w, int h); - - void DrawTicks(int x, int y, int w); - - private: - - JZSampleFrame* mpSampleFrame; - - JZSample& spl; - - int paint_offset; - int paint_length; - - JZSnapSelection snapsel; - - // sel_fr == 0: no selection and no insertion point - // sel_fr > 0 && sel_fr == sel_to: insertion point - // sel_fr > 0 && sel_fr < sel_to: selected range - int sel_fr, sel_to; - JZInsertionPoint inspt; - int mouse_up_sets_insertion_point; - JZSamplePlayPosition *playpos; - - // for tickmark display - bool midi_time; - int midi_offs; - - bool mouse_down; -}; - #ifdef OBSOLETE //***************************************************************************** //***************************************************************************** @@ -215,90 +145,6 @@ //***************************************************************************** //***************************************************************************** -class JZSamplePlayPosition : public wxTimer -{ - public: - - JZSamplePlayPosition( - JZSampleWindow& SampleWindow, - JZPlayer* pPlayer, - JZSample& Sample) - : cnvs(SampleWindow), - mpPlayer(pPlayer), - spl(Sample) - { - visible = false; - x = 0; - } - - ~JZSamplePlayPosition() - { - Stop(); - if (visible) - Draw(); - } - - void StopListen() - { - Stop(); - if (gpMidiPlayer->IsListening()) - gpMidiPlayer->ListenAudio(-1); - if (visible) - Draw(); - } - - void StartListen(int fr, int to) - { - fr_smpl = fr; - to_smpl = to; - gpMidiPlayer->ListenAudio(spl, fr_smpl, to_smpl); - Start(100); - } - - bool IsListening() const - { - return gpMidiPlayer->IsListening(); - } - - void Draw() - { - visible ^= 1; - wxDC *dc = new wxClientDC(&cnvs); - int cw, ch; - cnvs.GetClientSize(&cw, &ch); - dc->SetPen(*wxGREEN_PEN); - dc->SetLogicalFunction(wxXOR); - dc->DrawLine(x, 0, x, ch); - dc->SetPen(*wxBLACK_PEN); - dc->SetLogicalFunction(wxCOPY); - } - - virtual void Notify() - { - int pos = mpPlayer->GetListenerPlayPosition(); - if (pos < 0) - { - StopListen(); - return; - } - if (visible) - Draw(); - x = cnvs.Sample2Pixel(fr_smpl + pos); - Draw(); - } - - private: - JZSampleWindow& cnvs; - JZPlayer* mpPlayer; - JZSample& spl; - bool visible; - int x; - int fr_smpl; - int to_smpl; -}; - -//***************************************************************************** -//***************************************************************************** //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- JZSampleWindow::JZSampleWindow(JZSampleFrame* pSampleFrame, JZSample& Sample) @@ -565,13 +411,15 @@ BarInfo.SetBar(BarInfo.GetBarIndex()); while (BarInfo.GetClock() < cto) { - int ticks_per_count = BarInfo.GetTicksPerBar() / BarInfo.GetCountsPerBar(); + int ticks_per_count = + BarInfo.GetTicksPerBar() / BarInfo.GetCountsPerBar(); int ticks_per_step = ticks_per_count / 4; for (int i = 0; i < BarInfo.GetCountsPerBar(); ++i) { for (int j = 0; j < 4; j++) { - int clock = BarInfo.GetClock() + i * ticks_per_count + j * ticks_per_step; + int clock = + BarInfo.GetClock() + i * ticks_per_count + j * ticks_per_step; int xx = static_cast<int>(Map.XToY(clock)); // draw a tickmark line dc->DrawLine(xx, y - 5, xx, y); @@ -675,847 +523,3 @@ } -// ---------------------------------------------------------------- -// -------------------------- JZSampleFrame -------------------------- -// ---------------------------------------------------------------- - - -#include "Bitmaps/open.xpm" -#include "Bitmaps/save.xpm" -#include "Bitmaps/play.xpm" -#include "Bitmaps/help.xpm" -#include "Bitmaps/accept.xpm" -#include "Bitmaps/cancel.xpm" -#include "Bitmaps/zoomin.xpm" -#include "Bitmaps/zoomout.xpm" - -static JZToolDef tdefs[] = -{ - { wxID_OPEN, false, open_xpm, "open wave file" }, - { wxID_SAVE, false, save_xpm, "save wave file" }, - { JZToolBar::eToolBarSeparator }, - { wxID_ZOOM_IN, false, zoomin_xpm, "zoom to selection" }, - { wxID_ZOOM_OUT, false, zoomout_xpm, "zoom out" }, - { MEN_ACCEPT, false, accept_xpm, "accept painting" }, - { ID_PAINTER_NONE, false, cancel_xpm, "cancel painting" }, - { JZToolBar::eToolBarSeparator }, - { ID_PLAY, false, play_xpm, "play sample" }, - { MEN_HELP, false, help_xpm, "help" }, - { JZToolBar::eToolBarEnd } -}; - -int JZSampleFrame::geo[4] = -{ - 30, - 30, - 600, - 300 -}; - -JZSample *JZSampleFrame::copy_buffer; - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -JZSampleFrame::JZSampleFrame( - wxWindow* pParent, - JZSampleFrame **ref, - JZSample& Sample) - : wxFrame( - pParent, - wxID_ANY, - Sample.GetFileName(), - wxPoint(geo[0], geo[1]), - wxSize(geo[2], geo[3])), - spl(Sample), - vol_command(Sample), - pan_command(Sample), - pitch_command(Sample), - wah_command(Sample) -{ - this->ref = ref; - - in_constructor = true; - - cnvs = 0; - mpToolBar = 0; - scrol_panel = 0; - pos_scrol = 0; - zoom_scrol = 0; - num_params = 0; - on_accept = 0; - equalizer = 0; - distortion = 0; - reverb = 0; - echo = 0; - shifter = 0; - stretcher = 0; - filter = 0; - settings = 0; - wah_settings = 0; - pitch_settings = 0; - chorus = 0; - synth = 0; - - if (copy_buffer == 0) - copy_buffer = new JZSample(spl.SampleSet()); - - mpToolBar = new JZToolBar(this, tdefs); - - // Create a menu bar, the various menus with entries, and attach them to the - // menu bar. - - wxMenu* pMenu = 0; - wxMenu* pSubMenu = 0; - wxMenuBar* pMenuBar = new wxMenuBar; - - // Create and populate the File menu. - pMenu = new wxMenu; - - pMenu->Append(ID_FILE_REVERT_TO_SAVED, "&Revert to Saved"); - pMenu->Append(wxID_OPEN, "&Load..."); - pMenu->Append(wxID_SAVE, "&Save"); - pMenu->Append(wxID_SAVEAS, "&Save As..."); - pMenu->Append(wxID_CLOSE, "&Close"); - - pMenuBar->Append(pMenu, "&File"); - - // Create and populate the Edit menu. - pMenu = new wxMenu; - pMenu->Append(wxID_CUT, "&Cut"); - pMenu->Append(wxID_COPY, "Co&py"); - pMenu->Append(wxID_PASTE, "&Paste"); - pMenu->Append(ID_EDIT_PASTE_MERGE, "Paste &Merge"); - pSubMenu = new wxMenu; - pSubMenu->Append(MEN_SILENCE_OVR, "&Replace"); - pSubMenu->Append(MEN_SILENCE_INS, "&Insert"); - pSubMenu->Append(MEN_SILENCE_APP, "&Append"); - pMenu->Append(MEN_SILENCE, "&Silence", pSubMenu); - pSubMenu = new wxMenu; - pSubMenu->Append(MEN_FLIP_LEFT, "Left"); - pSubMenu->Append(MEN_FLIP_RIGHT, "Right"); - pMenu->Append(MEN_FLIP, "In&vert Phase", pSubMenu); - pMenu->Append(ID_EDIT_MAXIMIZE_VOLUME, "&Maximize Volume"); - pMenuBar->Append(pMenu, "&Edit"); - - pMenu = new wxMenu; - pMenu->Append(ID_PAINTERS_VOLUME, "&Volume..."); - pMenu->Append(ID_PAINTER_PAN, "&Panpot..."); - pMenu->Append(ID_PAINTER_PITCH, "&Pitch..."); - pMenu->Append(ID_PAINTER_WAHWAH, "&Filter..."); - pMenu->Append(ID_PAINTER_NONE, "&None..."); - pMenuBar->Append(pMenu, "&Painters"); - - pMenu = new wxMenu; - pMenu->Append(ID_EFFECTS_EQUALIZER, "&Equalizer..."); - pMenu->Append(ID_EFFECTS_FILTER, "&Filter..."); - pMenu->Append(ID_EFFECTS_DISTORTION, "&Distortion..."); - pMenu->Append(ID_EFFECTS_REVERB, "&Reverb..."); - pMenu->Append(ID_EFFECTS_ECHO, "&Echo..."); - pMenu->Append(ID_EFFECTS_CHORUS, "&Chorus..."); - pMenu->Append(ID_EFFECTS_PITCH_SHIFTER, "&Pitch shifter..."); - pMenu->Append(ID_EFFECTS_STRETCHER, "&Time stretcher..."); - pMenu->Append(ID_EFFECTS_REVERSE, "Re&verse"); - pMenu->Append(ID_EFFECTS_SYNTH, "&Synth..."); - pMenuBar->Append(pMenu, "&Effects"); - - pMenu = new wxMenu; - pMenu->Append(ID_SETTINGS_PITCH_PAINTER, "&Pitch Painter..."); - pMenu->Append(ID_SETTINGS_WAHWAH, "&Filter Painter..."); -// pMenu->Append(wxID_ZOOM_IN, "Zoom &In"); -// pMenu->Append(wxID_ZOOM_OUT, "Zoom &Out"); - pMenu->Append(ID_VIEW_SETTINGS, "&View Settings..."); - pMenuBar->Append(pMenu, "&Settings"); - - SetMenuBar(pMenuBar); - - // construct a panel containing the scrollbars - cnvs = new JZSampleWindow(this, spl); - scrol_panel = new wxPanel(this); - -//OBSOLETE pos_scrol = new wxScrollBar(scrol_panel, (wxFunction)ScrollCallback); - pos_scrol = new wxScrollBar(scrol_panel, wxID_ANY); -// pos_scrol->SetObjectLength(1000); -// pos_scrol->SetViewLength(1000); -// pos_scrol->SetValue(0); - pos_scrol->SetScrollbar(0, 1000, 1000, 1000); - -//OBSOLETE zoom_scrol = new wxScrollBar(scrol_panel, (wxFunction)ScrollCallback); - zoom_scrol = new wxScrollBar(scrol_panel, wxID_ANY); -// zoom_scrol->SetObjectLength(1000); -// zoom_scrol->SetViewLength(10); -// zoom_scrol->SetPageLength(100); -// zoom_scrol->SetValue(0); - zoom_scrol->SetScrollbar(0, 10, 1000, 100); - - in_constructor = false; - - // now force a resize for motif - int cw, ch; - GetClientSize(&cw, &ch); - OnSize(cw, ch); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -JZSampleFrame::~JZSampleFrame() -{ - *ref = 0; - GetPosition(&geo[0], &geo[1]); - GetSize(&geo[2], &geo[3]); - delete mpToolBar; - delete cnvs; - delete zoom_scrol; - delete pos_scrol; - delete scrol_panel; - for (int i = 0; i < num_params; i++) - delete params[i]; - delete equalizer; - delete distortion; - delete reverb; - delete echo; - delete chorus; - delete synth; - delete shifter; - delete stretcher; - delete filter; - delete settings; - delete wah_settings; - delete pitch_settings; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZSampleFrame::OnClose() -{ - return true; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::OnSize(int w, int h) -{ - // constructor finished? - if (in_constructor) - return; - - int cw, ch; - GetClientSize(&cw, &ch); - - wxSize ToolBarSize = mpToolBar->GetSize(); - int pw, ph; - pos_scrol->GetSize(&pw, &ph); - int zw, zh; - zoom_scrol->GetSize(&zw, &zh); - -//OBSOLETE mpToolBar->SetSize(0, 0, (int)cw, ToolBarSize.GetHeight()); - scrol_panel->SetSize(0, ch-zh-ph, cw, zh+ph); - zoom_scrol->SetSize(0, 0, cw, zh); - pos_scrol->SetSize(0, zh, cw, ph); - - // divide the remaining space on cnvs and params - int xx = 0; - int yy = ToolBarSize.GetHeight(); - int ww = cw; - int hh = ch - ToolBarSize.GetHeight() - zh - ph; - int nn = spl.GetChannelCount() + num_params; - - int hi = hh * spl.GetChannelCount() / nn; - cnvs->SetSize(xx, yy, ww, hi); - - hi = hh / nn; - for (int i = 0; i < num_params; i++) - { - int yi = yy + (i + spl.GetChannelCount()) * hh / nn; - params[i]->SetSize(xx, yi, ww, hi); - } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::Redraw() -{ - cnvs->Redraw(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZSampleFrame::HaveInsertionPoint(int &offs, bool warn) -{ - if (cnvs->sel_fr == cnvs->sel_to && cnvs->sel_fr >= 0) - { - offs = cnvs->sel_fr; - return true; - } - else - { - offs = -1; - if (warn) - wxMessageBox("please set insertion point first", "Error", wxOK); - return false; - } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -bool JZSampleFrame::HaveSelection( - int& fr_smpl, - int& to_smpl, - HaveSelectionMode mode) -{ - if (cnvs->sel_fr < cnvs->sel_to && cnvs->sel_fr >= 0) - { - fr_smpl = cnvs->sel_fr; - to_smpl = cnvs->sel_to; - return true; - } - else if (mode == SelAll) - { - fr_smpl = 0; - to_smpl = spl.GetLength(); - return true; - } - fr_smpl = to_smpl = -1; - if (mode == SelWarn) - wxMessageBox("please select samples first", "Error", wxOK); - return false; -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::AddParam(JZRndArray *array, const char *label) -{ - params[num_params] = new JZArrayEdit(this, *array, 0, 0, 10, 10, 0); - params[num_params]->SetLabel(label); - num_params++; - int cw, ch; - GetClientSize(&cw, &ch); - OnSize(cw, ch); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::ClrParam() -{ - if (num_params > 0) - { - int n = num_params; - num_params = 0; - for (int i = 0; i < n; ++i) - { - delete params[i]; - } - int cw, ch; - GetClientSize(&cw, &ch); - OnSize(cw, ch); - } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::ClearSelection() -{ - cnvs->ClearSelection(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::LoadError(JZSample& Sample) -{ - wxString Message; - Message << "Could not load " << Sample.GetFileName(); - ::wxMessageBox(Message, "Error", wxOK); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -extern int effect(JZSample &spl); - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::OnMenuCommand(int id) -{ - if (gpMidiPlayer->IsPlaying()) - { - return; - } - - // Player crashes if data disappear. - if (id != ID_PLAY) - { - cnvs->playpos->StopListen(); - } - - switch (id) - { - case ID_EFFECTS_EQUALIZER: - if (equalizer == 0) - equalizer = new JZEqualizer(*this); - equalizer->Show(true); - break; - - case MEN_FLIP_LEFT: - spl.Flip(0); - break; - case MEN_FLIP_RIGHT: - spl.Flip(1); - break; - - case ID_EFFECTS_DISTORTION: - if (distortion == 0) - distortion = new JZDistortion(*this); - distortion->Show(true); - break; - - case ID_EFFECTS_REVERB: -#ifdef OBSOLETE - if (reverb == 0) - { - // Old version was not modal. - reverb = new wxDialog(this, wxID_ANY, "Reverb"); - tReverbForm *form = new tReverbForm(*this); - form->EditForm(reverb); - reverb->Fit(); - } - ClearSelection(); - SetViewPos(0, spl.GetLength()); - reverb->Show(true); -#endif - break; - - case ID_EFFECTS_REVERSE: - { - int fr, to; - if (HaveSelection(fr, to)) - { - spl.Reverse(fr, to); - Redraw(); - } - } - break; - - case ID_EFFECTS_PITCH_SHIFTER: -#ifdef OBSOLETE - if (shifter == 0) - { - shifter = new wxDialogBox(this, "Shifter", false ); - tShifterForm *form = new tShifterForm(*this); - form->EditForm(shifter); - shifter->Fit(); - } - ClearSelection(); - SetViewPos(0, spl.GetLength()); - shifter->Show(true); -#endif - break; - - case ID_EFFECTS_STRETCHER: -#ifdef OBSOLETE - if (stretcher == 0) - { - stretcher = new wxDialogBox(this, "Stretcher", false ); - tStretcherForm *form = new tStretcherForm(*this); - form->EditForm(stretcher); - stretcher->Fit(); - } - ClearSelection(); - SetViewPos(0, spl.GetLength()); - stretcher->Show(true); -#endif - break; - - case ID_EFFECTS_FILTER: -#ifdef OBSOLETE - if (filter == 0) - { - filter = new wxDialogBox(this, "Filter", false ); - tSplFilterForm *form = new tSplFilterForm(*this); - form->EditForm(filter); - filter->Fit(); - } - filter->Show(true); -#endif - break; - - case ID_VIEW_SETTINGS: -#ifdef OBSOLETE - if (settings == 0) - { - settings = new wxDialogBox(this, "Settings", false ); - JZSmplWinSettingsForm *form = new JZSmplWinSettingsForm(*this); - form->EditForm(settings); - settings->Fit(); - } - settings->Show(true); -#endif - break; - - case ID_EFFECTS_ECHO: -#ifdef OBSOLETE - if (echo == 0) - { - echo = new wxDialogBox(this, "Echo", false ); - tEchoForm *form = new tEchoForm(*this); - form->EditForm(echo); - echo->Fit(); - } - ClearSelection(); - SetViewPos(0, spl.GetLength()); - echo->Show(true); -#endif - break; - - case ID_EFFECTS_CHORUS: -#ifdef OBSOLETE - if (chorus == 0) - { - chorus = new wxDialogBox(this, "Chorus", false ); - tChorusForm *form = new tChorusForm(*this); - form->EditForm(chorus); - chorus->Fit(); - } - ClearSelection(); - SetViewPos(0, spl.GetLength()); - chorus->Show(true); -#endif - break; - - case ID_EFFECTS_SYNTH: - if (synth == 0) - synth = new JZSynthDlg(*this); - synth->Show(true); - break; - - case MEN_ACCEPT: - if (on_accept) - { - int fr = GetPaintOffset(); - int to = fr + GetPaintLength(); - on_accept->OnAccept(fr, to); - delete on_accept; - on_accept = 0; - } - break; - - case ID_PAINTER_NONE: - if (on_accept) - { - delete on_accept; - on_accept = 0; - } - break; - - case wxID_CUT: - { - int fr, to; - if (HaveSelection(fr, to, SelWarn)) - { - spl.Cut(*copy_buffer, fr, to); - cnvs->ClearSelection(); - cnvs->SetInsertionPoint(fr); - Redraw(); - } - } - break; - - case wxID_COPY: - { - int fr, to; - if (HaveSelection(fr, to, SelAll)) - spl.Copy(*copy_buffer, fr, to); - } - break; - - case wxID_ZOOM_IN: - { - int fr, to; - if (HaveSelection(fr, to, SelWarn)) - SetViewPos(fr, to); - } - break; - - case wxID_ZOOM_OUT: - SetViewPos(0, spl.GetLength()); - break; - - case ID_EDIT_MAXIMIZE_VOLUME: - spl.Rescale(); - Redraw(); - break; - - case ID_PAINTERS_VOLUME: - delete on_accept; - on_accept = new JZCommandPainter(*this, vol_command); - break; - - case ID_PAINTER_WAHWAH: - delete on_accept; - on_accept = new JZCommandPainter(*this, wah_command); - break; - - case ID_SETTINGS_WAHWAH: -#ifdef OBSOLETE - if (wah_settings == 0) - { - wah_settings = new wxDialogBox(this, "Filter Painter", false); - tWahSettingsForm *form = new tWahSettingsForm(*this); - form->EditForm(wah_settings); - wah_settings->Fit(); - } - wah_settings->Show(true); -#endif - break; - - case ID_SETTINGS_PITCH_PAINTER: -#ifdef OBSOLETE - if (pitch_settings == 0) - { - pitch_settings = new wxDialogBox(this, "Pitch Painter"); - tSplPitchForm *form = new tSplPitchForm(*this); - form->EditForm(pitch_settings); - pitch_settings->Fit(); - } - pitch_settings->Show(true); -#endif - break; - - - case ID_PAINTER_PAN: - delete on_accept; - on_accept = new JZCommandPainter(*this, pan_command); - break; - - case ID_EDIT_PASTE_MERGE: - { - int offs; - if (HaveInsertionPoint(offs)) - { - spl.PasteMix(*copy_buffer, offs); - cnvs->SetSelection(offs, offs + copy_buffer->GetLength()); - Redraw(); - } - } - break; - - case wxID_PASTE: - { - int offs, fr, to; - if (HaveInsertionPoint(offs, false)) - { - spl.PasteIns(*copy_buffer, offs); - cnvs->SetSelection(offs, offs + copy_buffer->GetLength()); - Redraw(); - } - else if (HaveSelection(fr, to, SelWarn)) - { - spl.PasteOvr(*copy_buffer, fr, to); - cnvs->SetInsertionPoint(fr); - Redraw(); - } - } - break; - - case MEN_SILENCE_INS: - { - int fr, to; - if (HaveSelection(fr, to, SelWarn)) - { - spl.InsertSilence(fr, to - fr); - Redraw(); - } - } - break; - - case MEN_SILENCE_APP: - { - int fr, to; - if (HaveSelection(fr, to, SelWarn)) - { - spl.InsertSilence(to, to - fr); - Redraw(); - } - } - break; - - case MEN_SILENCE_OVR: - { - int fr, to; - if (HaveSelection(fr, to, SelWarn)) - { - spl.ReplaceSilence(fr, to - fr); - Redraw(); - } - } - break; - - case ID_PAINTER_PITCH: - delete on_accept; - SetViewPos(0, spl.GetLength()); - on_accept = new JZCommandPainter(*this, pitch_command); - break; - - case ID_FILE_REVERT_TO_SAVED: - cnvs->ClearSelection(); - if (spl.Load(true)) - LoadError(spl); - Redraw(); - break; - - case wxID_CLOSE: -// DELETE_THIS(); - Destroy(); - break; - - case ID_PLAY: - cnvs->Play(); - break; - - case wxID_OPEN: - { - wxString FileName = file_selector( - spl.GetFileName(), - "Load Sample", - false, - false, - "*.wav"); - if (!FileName.empty()) - { - wxBeginBusyCursor(); - cnvs->ClearSelection(); - spl.SetFileName(FileName); - if (spl.Load(true)) - { - LoadError(spl); - } - spl->RefreshDialogs(); - SetTitle(FileName); - Redraw(); - wxEndBusyCursor(); - } - } - break; - - case wxID_SAVEAS: - { - wxString FileName = file_selector( - spl.GetFileName(), - "Save Sample", - true, - false, - "*.wav"); - if (!FileName.empty()) - { - spl.SetFileName(FileName); - OnMenuCommand(wxID_SAVE); - spl->RefreshDialogs(); - SetTitle(FileName); - } - } - break; - - case wxID_SAVE: - { - if (spl.GetFileName().empty()) - { - OnMenuCommand(wxID_SAVEAS); - } - else - { - wxBeginBusyCursor(); - cnvs->ClearSelection(); - int err = spl.Save(); - Redraw(); - wxEndBusyCursor(); - if (err) - { - wxMessageBox("writing failed!!", "Error", wxOK); - } - } - } - break; - - case MEN_HELP: - gpHelpInstance->ShowTopic("Sample Editor"); - break; - - default: - break; - } -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::PlaySample() -{ - cnvs->Play(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int JZSampleFrame::GetPaintLength() -{ - // return the visible amount of sample data - double sb = zoom_scrol->GetThumbPosition(); - JZMapper Map(0, 1000, spl.GetLength(), 0); - int len = static_cast<int>(Map.XToY(sb)); - return spl.Align(len); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -int JZSampleFrame::GetPaintOffset() -{ - // return the visible Offset in sample data - double sb = pos_scrol->GetThumbPosition(); - JZMapper Map(0, 1000, 0, spl.GetLength()); - int ofs = static_cast<int>(Map.XToY(sb)); - return spl.Align(ofs); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::SetViewPos(int fr, int to) -{ - JZMapper Map(0, spl.GetLength(), 0, 1000); - int zval = 1000 - (int)Map.XToY(to - fr); - zoom_scrol->SetThumbPosition(zval); - - int pval = (int)Map.XToY(fr); - if (pval > zval) - pval = zval; - - // avoid motif warnings: by setting a very small length, - // every position is valid. -// pos_scrol->SetViewLength(1); -// pos_scrol->SetValue(pval); -// pos_scrol->SetViewLength(1000 - zval); -// pos_scrol->SetPageLength((1000 - zval) * 2 / 3); - pos_scrol->SetScrollbar(pval, 1, 1000 - zval, (1000 - zval) * 2 / 3); - - Redraw(); -} - -#ifdef OBSOLETE -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::OnScroll(wxItem &item) -{ - int zval = zoom_scrol->GetValue(); - int pval = pos_scrol->GetValue(); - - if (pval > zval) - pval = zval; - - pos_scrol->SetValue(pval); - pos_scrol->SetViewLength(1000 - zval); - pos_scrol->SetPageLength((1000 - zval) * 2 / 3); - - Redraw(); -} - -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -void JZSampleFrame::ScrollCallback(wxItem &itm, wxCommandEvent& Event) -{ - ((JZSampleFrame *)(itm.GetParent()->GetParent()))->OnScroll(itm); -} -#endif Modified: trunk/jazz/src/SampleWindow.h =================================================================== --- trunk/jazz/src/SampleWindow.h 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/src/SampleWindow.h 2010-07-17 21:15:00 UTC (rev 810) @@ -23,106 +23,163 @@ #ifndef JZ_SAMPLEWINDOW_H #define JZ_SAMPLEWINDOW_H -#include "SampleCommand.h" +#include "MouseAction.h" -#include <wx/frame.h> +#include <wx/scrolwin.h> -class JZRndArray; -class JZToolBar; -class JZArrayEdit; -class JZCommandPainter; -class JZDistortion; -class JZEqualizer; +class JZPlayer; class JZSample; +class JZSampleFrame; class JZSampleWindow; -class JZSynthDlg; -class wxDialog; -class wxScrollBar; //***************************************************************************** //***************************************************************************** -class JZSampleFrame : public wxFrame +class JZInsertionPoint { - friend class JZSampleWindow; - friend class JZCommandPainter; - friend class JZSmplWinSettingsForm; + public: + JZInsertionPoint(wxScrolledWindow* pScrolledWindow) + : mpScrolledWindow(pScrolledWindow) + { + last_x = 0; + visible = 0; + } + + void Draw(int x); + + void Draw() + { + Draw(last_x); + } + + int IsVisible() const + { + return visible; + } + + float GetX() const + { + return last_x; + } + + private: + + int last_x; + int visible; + wxScrolledWindow* mpScrolledWindow; +}; + +//***************************************************************************** +//***************************************************************************** +class JZSamplePlayPosition : public wxTimer +{ public: - JZSampleFrame(wxWindow* pParent, JZSampleFrame** ref, JZSample& Sample); - ~JZSampleFrame(); - virtual void OnSize(int w, int h); - virtual bool OnClose(); - virtual void OnMenuCommand(int id); - void Redraw(); - bool HaveInsertionPoint(int &offs, bool warn = TRUE); - enum HaveSelectionMode + JZSamplePlayPosition( + JZSampleWindow& SampleWindow, + JZPlayer* pPlayer, + JZSample& Sample) + : cnvs(SampleWindow), + mpPlayer(pPlayer), + spl(Sample) { - SelWarn, - SelNoWarn, - SelAll - }; - bool HaveSelection(int &fr_smpl, int &to_smpl, HaveSelectionMode = SelAll); + visible = false; + x = 0; + } - void AddParam(JZRndArray *array, const char *label); - void ClrParam(); - void ClearSelection(); - JZSample &GetSample() + ~JZSamplePlayPosition() { - return spl; + Stop(); + if (visible) + Draw(); } - void PlaySample(); + void StopListen(); + + void StartListen(int fr, int to); + + bool IsListening() const; + + void Draw(); + + virtual void Notify(); + private: + JZSampleWindow& cnvs; + JZPlayer* mpPlayer; + JZSample& spl; + bool visible; + int x; + int fr_smpl; + int to_smpl; +}; - int GetPaintLength(); - int GetPaintOffset(); -#ifdef OBSOLETE - static void ScrollCallback(wxItem &itm, wxCommandEvent& event); - void OnScroll(wxItem &item); -#endif - void SetViewPos(int fr, int to); - void LoadError(JZSample &spl); +//***************************************************************************** +//***************************************************************************** +class JZSampleWindow : public wxScrolledWindow +{ + friend class JZSampleFrame; + friend class JZSmplWinSettingsForm; + public: + + JZSampleWindow(JZSampleFrame* pSampleFrame, JZSample& Sample); + + virtual ~JZSampleWindow(); + + void Redraw() + { + OnPaint(); + } + + virtual void OnPaint(); + + virtual void OnSize(int w, int h); + + virtual void OnEvent(wxMouseEvent& MouseEvent); + + void ClearSelection(); + + void SetInsertionPoint(int offs); + + void SetSelection(int fr, int to); + + int Sample2Pixel(int sample); + + int Pixel2Sample(float pixel); + + void Play(); + private: + void DrawSample(int channel, int x, int y, int w, int h); + + void DrawTicks(int x, int y, int w); + + private: + + JZSampleFrame* mpSampleFrame; + JZSample& spl; - JZSampleWindow* cnvs; - wxPanel* scrol_panel; - wxScrollBar* pos_scrol; - wxScrollBar* zoom_scrol; - JZToolBar* mpToolBar; - int in_constructor; - JZSampleFrame** ref; - static int geo[4]; - static JZSample* copy_buffer; + int paint_offset; + int paint_length; - enum - { - MAXPARAM = 4 - }; - JZArrayEdit* params[MAXPARAM]; - int num_params; + JZSnapSelection snapsel; - JZCommandPainter* on_accept; - JZSplVolume vol_command; - JZSplPan pan_command; - JZSplPitch pitch_command; - JZWahWah wah_command; + // sel_fr == 0: no selection and no insertion point + // sel_fr > 0 && sel_fr == sel_to: insertion point + // sel_fr > 0 && sel_fr < sel_to: selected range + int sel_fr, sel_to; + JZInsertionPoint inspt; + int mouse_up_sets_insertion_point; + JZSamplePlayPosition *playpos; - JZEqualizer* equalizer; - JZDistortion* distortion; - JZSynthDlg* synth; - wxDialog* reverb; - wxDialog* echo; - wxDialog* chorus; - wxDialog* shifter; - wxDialog* stretcher; - wxDialog* filter; - wxDialog* settings; - wxDialog* wah_settings; - wxDialog* pitch_settings; + // for tickmark display + bool midi_time; + int midi_offs; + + bool mouse_down; }; #endif // !defined(JZ_SAMPLEWINDOW_H) Modified: trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj =================================================================== --- trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-07-17 20:17:47 UTC (rev 809) +++ trunk/jazz/vc9/JazzPlusPlus-VC9.vcproj 2010-07-17 21:15:00 UTC (rev 810) @@ -938,6 +938,14 @@ > </File> <File + RelativePath="..\src\SampleFrame.cpp" + > + </File> + <File + RelativePath="..\src\SampleFrame.h" + > + </File> + <File RelativePath="..\src\SampleWindow.cpp" > </File> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pst...@us...> - 2011-03-23 00:23:55
|
Revision: 835 http://jazzplusplus.svn.sourceforge.net/jazzplusplus/?rev=835&view=rev Author: pstieber Date: 2011-03-23 00:23:45 +0000 (Wed, 23 Mar 2011) Log Message: ----------- Let autoreconf --install copy these. Removed Paths: ------------- trunk/jazz/config/depcomp trunk/jazz/config/install-sh trunk/jazz/config/ltmain.sh trunk/jazz/config/missing trunk/jazz/config/mkinstalldirs trunk/jazz/m4/libtool.m4 trunk/jazz/m4/ltoptions.m4 trunk/jazz/m4/ltsugar.m4 trunk/jazz/m4/ltversion.m4 trunk/jazz/m4/lt~obsolete.m4 Deleted: trunk/jazz/config/depcomp =================================================================== --- trunk/jazz/config/depcomp 2011-03-22 23:54:45 UTC (rev 834) +++ trunk/jazz/config/depcomp 2011-03-23 00:23:45 UTC (rev 835) @@ -1,584 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2006-10-15.18 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software -# Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva <ol...@dc...>. - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to <bug...@gn...>. -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> $depfile - echo >> $depfile - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> $depfile - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` - tmpdepfile="$stripped.u" - if test "$libtool" = yes; then - "$@" -Wc,-M - else - "$@" -M - fi - stat=$? - - if test -f "$tmpdepfile"; then : - else - stripped=`echo "$stripped" | sed 's,^.*/,,'` - tmpdepfile="$stripped.u" - fi - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - - if test -f "$tmpdepfile"; then - outname="$stripped.o" - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" - sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. - sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no - for arg in "$@"; do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix="`echo $object | sed 's/^.*\././'`" - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test $1 != '--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o, - # because we must use -o when running libtool. - "$@" || exit $? - IFS=" " - for arg - do - case "$arg" in - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: Deleted: trunk/jazz/config/install-sh =================================================================== --- trunk/jazz/config/install-sh 2011-03-22 23:54:45 UTC (rev 834) +++ trunk/jazz/config/install-sh 2011-03-23 00:23:45 UTC (rev 835) @@ -1,507 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2006-10-14.15 - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -posix_glob= -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chmodcmd=$chmodprog -chowncmd= -chgrpcmd= -stripcmd= -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src= -dst= -dir_arg= -dstarg= -no_target_directory= - -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: --c (ignored) --d create directories instead of installing files. --g GROUP $chgrpprog installed files to GROUP. --m MODE $chmodprog installed files to MODE. --o USER $chownprog installed files to USER. --s $stripprog installed files. --t DIRECTORY install into DIRECTORY. --T report an error if DSTFILE is a directory. ---help display this help and exit. ---version display version info and exit. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - shift - shift - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -s) stripcmd=$stripprog - shift - continue;; - - -t) dstarg=$2 - shift - shift - continue;; - - -T) no_target_directory=true - shift - continue;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac -done - -if test $# -ne 0 && test -z "$dir_arg$dstarg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dstarg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" - shift # fnord - fi - shift # arg - dstarg=$arg - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names starting with `-'. - case $src in - -*) src=./$src ;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dstarg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - - dst=$dstarg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst ;; - esac - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dstarg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix=/ ;; - -*) prefix=./ ;; - *) prefix= ;; - esac - - case $posix_glob in - '') - if (set -f) 2>/dev/null; then - posix_glob=true - else - posix_glob=false - fi ;; - esac - - oIFS=$IFS - IFS=/ - $posix_glob && set -f - set fnord $dstdir - shift - $posix_glob && set +f - IFS=$oIFS - - prefixes= - - for d - do - test -z "$d" && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dst"; then - $doit $rmcmd -f "$dst" 2>/dev/null \ - || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ - && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ - || { - echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - else - : - fi - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - } || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: Deleted: trunk/jazz/config/ltmain.sh =================================================================== --- trunk/jazz/config/ltmain.sh 2011-03-22 23:54:45 UTC (rev 834) +++ trunk/jazz/config/ltmain.sh 2011-03-23 00:23:45 UTC (rev 835) @@ -1,8406 +0,0 @@ -# Generated from ltmain.m4sh. - -# ltmain.sh (GNU libtool) 2.2.6b -# Written by Gordon Matzigkeit <go...@gn...>, 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print informational messages (default) -# --version print version information -# -h, --help print short or long help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.6b -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to <bug...@gn...>. - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=2.2.6b -TIMESTAMP="" -package_revision=1.3017 - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# NLS nuisances: We save the old values to restore during execute mode. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done - -$lt_unset CDPATH - - - - - -: ${CP="cp -f"} -: ${ECHO="echo"} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SED="/bin/sed"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -dirname="s,/[^/]*$,," -basename="s,^.*/,," - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` -} - -# Generated shell functions inserted here. - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - -# The name of this program: -# In the unlikely event $progname began with a '-', it would play havoc with -# func_echo (imagine progname=-n), so we prepend ./ in that case: -func_dirname_and_basename "$progpath" -progname=$func_basename_result -case $progname in - -*) progname=./$progname ;; -esac - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=: - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname${mode+: }$mode: $*" -} - -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` - done - my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "X$my_tmpdir" | $Xsed -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "X$1" | $Xsed \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - - - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $SED -n '/^# Usage:/,/# -h/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - $ECHO - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help -# Echo long help message to standard output and exit. -func_help () -{ - $SED -n '/^# Usage:/,/# Report bugs to/ { - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ - p - }' < "$progpath" - exit $? -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - func_error "missing argument for $1" - exit_cmd=exit -} - -exit_cmd=: - - - - - -# Check that we have a working $ECHO. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then - # Yippee, $ECHO works! - : -else - # Restart under the correct shell, and then maybe $ECHO will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit $EXIT_SUCCESS -fi - -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" - -# Global variables. -# $mode is unset -nonopt= -execute_dlfiles= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -opt_dry_run=false -opt_duplicate_deps=false -opt_silent=false -opt_debug=: - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -# func_fatal_configuration arg... -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." -} - - -# func_config -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' - - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" - - # Now print the configurations for the tags. - for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" - done - - exit $? -} - -# func_features -# Display the features supported by this script. -func_features () -{ - $ECHO "host: $host" - if test "$build_libtool_libs" = yes; then - $ECHO "enable shared libraries" - else - $ECHO "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $ECHO "enable static libraries" - else - $ECHO "disable static libraries" - fi - - exit $? -} - -# func_enable_tag tagname -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname="$1" - - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac - - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - -# Parse options once, thoroughly. This comes as soon as possible in -# the script to make things like `libtool --version' happen quickly. -{ - - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac - - # Parse non-mode specific arguments: - while test "$#" -gt 0; do - opt="$1" - shift - - case $opt in - --config) func_config ;; - - --debug) preserve_args="$preserve_args $opt" - func_echo "enabling shell trace mode" - opt_debug='set -x' - $opt_debug - ;; - - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break - execute_dlfiles="$execute_dlfiles $1" - shift - ;; - - --dry-run | -n) opt_dry_run=: ;; - --features) func_features ;; - --finish) mode="finish" ;; - - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break - case $1 in - # Valid mode arguments: - clean) ;; - compile) ;; - execute) ;; - finish) ;; - install) ;; - link) ;; - relink) ;; - uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; - esac - - mode="$1" - shift - ;; - - --preserve-dup-deps) - opt_duplicate_deps=: ;; - - --quiet|--silent) preserve_args="$preserve_args $opt" - opt_silent=: - ;; - - --verbose| -v) preserve_args="$preserve_args $opt" - opt_silent=false - ;; - - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break - preserve_args="$preserve_args $opt $1" - func_enable_tag "$1" # tagname is set here - shift - ;; - - # Separate optargs to long options: - -dlopen=*|--mode=*|--tag=*) - func_opt_split "$opt" - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} - shift - ;; - - -\?|-h) func_usage ;; - --help) opt_help=: ;; - --version) func_version ;; - - -*) func_fatal_help "unrecognized option \`$opt'" ;; - - *) nonopt="$opt" - break - ;; - esac - done - - - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps - ;; - esac - - # Having warned about all mis-specified options, bail out if - # anything was wrong. - $exit_cmd $EXIT_FAILURE -} - -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -## ----------- ## -## Main. ## -## ----------- ## - -$opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - test -z "$mode" && func_fatal_error "error: you must specify a MODE." - - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$mode' for more information." -} - - -# func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case "$lalib_p_line" in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test "$lalib_p" = yes -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - func_lalib_p "$1" -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_l... [truncated message content] |