From: <sag...@us...> - 2014-12-21 00:36:12
|
Revision: 4662 http://sourceforge.net/p/modplug/code/4662 Author: saga-games Date: 2014-12-21 00:35:49 +0000 (Sun, 21 Dec 2014) Log Message: ----------- [Mod] Update release package documents [Mod] OpenMPT: Version is now 1.24.01.00 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/installer/packageTemplate/readme.txt trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/readme.txt Added Paths: ----------- trunk/OpenMPT/packageTemplate/OMPT_1.24_ReleaseNotes.html trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/ trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/midimapping.png trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/missingsamples.png Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-12-20 20:06:32 UTC (rev 4661) +++ trunk/OpenMPT/common/versionNumber.h 2014-12-21 00:35:49 UTC (rev 4662) @@ -18,8 +18,8 @@ //Version definitions. The only thing that needs to be changed when changing version number. #define VER_MAJORMAJOR 1 #define VER_MAJOR 24 -#define VER_MINOR 00 -#define VER_MINORMINOR 23 +#define VER_MINOR 01 +#define VER_MINORMINOR 00 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/installer/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/installer/packageTemplate/readme.txt 2014-12-20 20:06:32 UTC (rev 4661) +++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2014-12-21 00:35:49 UTC (rev 4662) @@ -1,5 +1,5 @@ ****************** -* OpenMPT 1.23 * +* OpenMPT 1.24 * ****************** @@ -52,7 +52,7 @@ OpenMPT_SoundTouch_f32.dll: SoundTouch library used in time stretching feature. readme.txt: This document unmo3.dll: Used in MO3-file import. -OMPT_1.23_ReleaseNotes.html: Release notes for this version. +OMPT_1.24_ReleaseNotes.html: Release notes for this version. License Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2014-12-20 20:06:32 UTC (rev 4661) +++ trunk/OpenMPT/packageTemplate/History.txt 2014-12-21 00:35:49 UTC (rev 4662) @@ -4,7 +4,7 @@ [Fix]: bug fix [New]: new feature [Imp]: improvement -[Reg]: known issue / regression +[Reg]: known issue / regression / feature removal [Mod]: change [Var]: other (tx XYZ): thanks to XYZ for telling us about the bug / requesting the feature @@ -25,6 +25,153 @@ <ks> coda / Ken Snyder +v1.24.01.00 (21 December 2014, revision 4662) +--------------------------------------------- +General tab + [Imp] <js> Clicking on the song type opens Song Properties dialog. + [Imp] <js> If available, show a descriptive parameter value for plugin parameters instead of its numerical representation. + +Pattern tab + [New] <js> Ctrl + (Shift +) Scroll wheel can now be used as a replacement for the "(Coarse) Data Entry" shortcuts (http://bugs.openmpt.org/view.php?id=613). + [Imp] <js> When previewing instruments with a fadeout value of 0, instantly stop them on key-up instead of letting them play forever. + [Fix] <js> "Continue song as soon as MIDI notes are being received" didn't work in some situations. + [Fix] <js> When using "Continue song as soon as MIDI notes are being received", the Edit Step setting was erroneously applied to the first note. + [Fix] <js> When dragging a selection in the order list one order to the right, the document was marked as modified even though there was no change. + [Fix] <js> Fixed crash when a module has no patterns at all. + [Fix] <js> When only one parameter column was selected, the interpolation context menu didn't offer to interpolate this column. + +Sample tab + [New] <js> Support resampling to any arbitrary sampling rate using r8brain-free. Includes new keyboard shortcuts for upsampling, downsampling and resampling. + [New] <js> As upsampling no longer automatically converts the sample to 16-bit, 16-bit conversion is now a separate option. + [New] <js> Custom background and selection colours can now be specified (http://bugs.openmpt.org/view.php?id=371). + [Imp] <js> Adjusting the sample frequency updates all playing notes' sample frequency (only works with IT and MPTM for now). + [Imp] <js> Improved sample loop point input behaviour so that a loop start value greater than the current loop end value can be entered without having to enter the new loop end first. + [Imp] <js> Finetune and transpose modifications are now undo-able. + [Imp] <js> Visually distinguish sustain loop and sample grid markers. + [Imp] <js> No longer show unsupported sample vibrato types in IT (Ramp Up) and XM (Random). + [Fix] <js> Ramp Up and Ramp Down labels in XM vibrato settings were swapped since forever. + [Fix] <js> When editing XM vibrato settings, the edit cursor always jumped back to the first character in the edit field. + [Fix] <js> Rearranging samples (e.g. through song cleanup or the tree view) no longer messes up the undo buffer history (http://bugs.openmpt.org/view.php?id=600). + [Fix] <js> The sample transpose dropdown was missing two complete octaves. The range has been extended and turned upside down (can now be understood intuitively as "C-5 is being played like note x"). + [Fix] <js> Silencing a single sample point lead to a crash (http://bugs.openmpt.org/view.php?id=610). + +Instrument tab + [New] <js> ITI instrument files can now contain external samples (like MPTM files). Select "Impulse Tracker Instruments with external Samples" from the save dialog (http://forum.openmpt.org/index.php?topic=2515.0). + [New] <js> The first instrument of a soundfont can now be loaded directly without registering the soundfont in OpenMPT. + [New] <js> Custom background colour can now be specified. + [Imp] <js> Since Impulse Tracker's fade-out value is 32 times less precise than what is displayed in the editor, automatically round it when the user makes fade-out adjustments in IT files. + [Imp] <js> When previewing instruments with a fadeout value of 0, instantly stop them on key-up instead of letting them play forever. + [Fix] <js> When loading an instrument, force all sample views of the same module to be updated. + [Fix] <js> Modifying envelopes using the keyboard didn't mark the module as modified. + [Reg] <js> Disallow OpenMPT-only "attack" setting to be used in IT and XM files. + +Tree view + [New] <js> Dropping a module or folder on the sample browser opens this module or folder for browsing. + [New] <js> Dropping a soundfont file on the upper part of the tree view adds it to the list of soundfonts. + [New] <js> Due to the change from external instruments in the ITP format to external samples in MPTM, "Set Path" and "Save" have been moved to samples. External samples are marked with [external], missing external samples are marked with [missing]. + [New] <js> Sample waveforms can now be reloaded from disk (e.g. after editing a sample in an external application) if OpenMPT knows the sample's original path, e.g. after loading or saving it, or using MPTM's external sample feature (http://bugs.openmpt.org/view.php?id=207). + [New] <js> The first instrument of a soundfont can now be previewed directly from the sample browser (without registering the soundfont in OpenMPT). + [Mod] <js> Apparently, some versions of Ableton Live mark exported WAV files as "temporary". Such files are no longer ignored in the sample browser. + [Fix] <js> Duplicating samples was broken in OpenMPT 1.23. + [Fix] <js> Previewing IMA ADPCM-compressed samples from the tree view was broken if the previously previewed sample was a stereo sample. + +Mod Conversion + [Imp] <js> When converting from IT / MPTM to XM, move volume column portamento to the effect column if possible, as it has a different meaning in XM. + [Fix] <js> When converting from XM to IT / MPTM, volume column effects were not always limited properly. + +VST / DMO Plugins + [Imp] <js> When adding a new plugin through the plugin manager that is missing from some open file, it is now automatically loaded and restored in that file. + [Imp] <js> "Randomize Parameters" now applies a customizable randomization factor - much more useful than completely random parameters. + [Fix] <js> Regularly send editor idle commands to plugins with open editors. + +VST::Plugin Bridge + [Imp] <js> The plugin bridge does now also create crash dumps automatically. OpenMPT's /fullMemDump command line switch also applies to these dumps. + [Mod] <js> By default, all instances of the same plugin do now share one bridge process, since a handful of plugins require this - and the loading performance is much better, too. + [Fix] <js> Catch potential crashes while loading the plugin, like in OpenMPT (fixes instant crashes with multiple instances of SideKick v3 in different processes). + +Playback + [New] <js> S70 / S71 / S72 commands do now also work with instrument plugins. + [Imp] <js> Smooth MIDI macros do now, to some extent, work with external MIDI messages. They interpolate from the previous Zxx or \xx parameter from the same channel to the new parameter. + [Mod] <js> In all mix modes since 1.17RC2, a way too long volume ramp (some times up to 100 times longer than the user-supplied ramp setup) was applied for extreme global volume changes. This is now disabled except for legacy 1.17RC2 mix mode. + [Mod] <js> Re-implemented stereo separation to be applied on the master mix. This means that it also works as expected with stereo samples and plugins now. + [Fix] <js> NNA / DCA settings were not applied properly to plugins assigned to sample-less instruments. + [Fix] <js> Instrument plugin arpeggio was executed on muted channels / instruments. + [Fix] <js> Linear frequency slide mode (in all formats except XM, which already worked as intended) has been re-implemented to fix some unwanted inaccuracies which can add up very quickly when using extra-fine slides. + [Fix] <js> Glissando should only affect tone portamento, not portamento up / down effects. + +MTPM + [New] <js> MPTM files can now contain external (on-disk) samples. When checking the "Keep sample on disk" checkbox in the sample editor, the sample data is not stored directly in the MPTM file but a relative link to the original sample file is kept (http://bugs.openmpt.org/view.php?id=368). + +IT + [Imp] <js> Added support for reading encrypted edit time in old IT files with no edit history present (discovered through Impulse Tracker source release, yay). + +XM + [Mod] <js> Revert XM compatibility export to always write out 256 order items. + [Fix] <js> Use "normal" compatible mix mode instead of FT2 panning mix mode for XM files that were compatibility-exported with OpenMPT 1.22 or older, and XM files made with other trackers that use linear panning. + +XM::Compatible Playback Mode + [Fix] <js> Make arpeggio after portamento effect behave even more like in Fasttracker 2. + +S3M::Compatible Playback Mode + [New] <js> Compatible playback mode for S3M: When enabled, OpenMPT emulates certain ScreamTracker quirks as it did until now (linked pattern effect memory and ignored effects on muted channels). Compatible mode is disabled automatically for files made with less compatible trackers. S3M files made with OpenMPT always have this mode enabled, and its state is not saved in S3M files. + +MOD + [Imp] <js> Amiga frequency limits can now also be enforced without activating ProTracker 1/2 mode. + +MOD::Loading and Saving + [Mod] <js> M.K. and M!K! files that only have Amiga-compatible notes in their patterns automatically enforce Amiga frequency limits now (http://bugs.openmpt.org/view.php?id=563). + [Fix] <js> Saving a sample loop with an odd length is now handled better (http://bugs.openmpt.org/view.php?id=590). + [Fix] <js> Any non-ASCII characters were accidentally removed when loading a MOD file (broke in OpenMPT 1.22). + +MOD::ProTracker 1/2 Mode + [Fix] <js> Glissando is only applied on rows with a portamento effects, and never on the first tick of these rows. + +Other formats + [New] <js> Added support for a MOD variant introduced by SoundTracker 2.6 and Ice Tracker (http://bugs.openmpt.org/view.php?id=597). + [Imp] <js> SoundTracker auto-slides are now imported using the volume column. + [Imp] <js> MT2: Completely rewrote loader. Some files that would previously not load properly do now load. Support for VST plugins, drum patterns and some extended MT2 pattern commands has been added. + [Fix] <js> ITP: Always load embedded MIDI macros for files made with OpenMPT 1.19 or older, since back then they were always read, no matter if the embed flag was checked or not. + [Fix] <js> ITP: Loading extended song properties was broken for a very long time, probably since OpenMPT 1.20. + [Reg] <js> ITP: Saving and editing ITP files is no longer supported. ITP files are now imported as normal IT files. ITP's functionality is superseded by MPTM's new external sample functionality. + +Module Export + [Fix] <js> F00 "stop song" abort detection for XM files didn't abort if there were samples playing with a global volume of 0. + +Module cleanup + [New] <js> "Remove unused sample data" now also finds samples with identical stereo channels and offers to optimize them to mono. + [Imp] <js> Give information about how many plugins were removed. + [Fix] <js> Removing unused samples no longer creates two undo points per sample. + +Audio I/O + [New] <jh> Support direct mode for WaveOut devices. This is mostly useful on Wine systems where it (for certain setups) prevents the Wine-internal resampler from kicking in. + [Imp] <jh> Increased latency and period precision to allow sub-millisecond latencies. + [Imp] <jh> Added per-device type default audio settings. + [Mod] <jh> Query PortAudio for the default latency of PortAudio sound devices. + [Mod] <jh> When changing between mono / stereo / quad channel configurations, always reset the channel mapping to default instead of basing the new one on the previous one. + [Mod] <jh> Add a hidden setting setting PreferSameTypeIfDeviceUnavailable in [Sound Settings] which optionally changes the algorithm for selecting the fallback device if the device selected by the user (or read from the configuration) is currently unavailable. When this setting is set, a device of the same type as the currently selected is preferred instead of just defaulting to wave mapper. + [Fix] <jh> If the soundcard is currently unavailable, some ASIO drivers allow opening the driver and report zero input and output channels in that case. Other drivers do not support loading the driver. In both cases, OpenMPT will now disallow selecting the driver in the setup dialog and hide it until restarting OpenMPT or the sound devices get rescanned. + +Misc + [New] <js> Dropping a folder that contains modules or VST plugins opens / registers them directly now (http://bugs.openmpt.org/view.php?id=510). + [New] <js> Remember window positions for each tune individually when it is being saved. Plugin window positions are now stored using the same mechanism instead of being embedded into the module files. (http://forum.openmpt.org/index.php?topic=3280.0). + [New] <js> Added a first-start dialog to set up some common settings. The corresponding settings have been removed from the installer. + [Imp] <js> Song length estimation: Slightly improve calculation of nested pattern loops (http://bugs.openmpt.org/view.php?id=591). + [Imp] <js> Song length estimation shows the length of all "hidden" subtunes in the current sequence. + [Imp] <js> Made the MIDI Mapping dialog's mapping list more human-readable. + [Imp] <jh> VU Meter: Rear channels are now also shown in quad mode. + [Mod] <js> When merging the default key map into a custom key map, event types are now completely ignored, so if e.g. the user has assigned a certain key on "key hold" but the default key map uses the same key on "key down" only, this version is no longer added. + [Mod] <js> Autosave: When "Use song's original directory" is enabled, but the song has not been saved so far, it is now saved in a sub folder called "Autosave" instead of the root of the settings directory. In this case, modules created from templates are now also autosaved into this folder instead of the template folder. + [Mod] <jh> Added setting LoadOnStartup in [Components] to optionally load all optional components (such as MP3 encoders, UNMO3, etc.) on startup rather than first use. KeepLoaded (also in [Components]) determines whether components stay in memory after they have been used (this is the default behaviour). + [Mod] <js> Rename "Colours" settings tab to "Display". + [Mod] <jh> Update lhasa to version 2014-07-12 (adds support for lhx archives). + [Mod] <jh> Update FLAC to v1.3.1 (improved decoding and encoding efficiency, fixed two vulnerabilities when loading malicious FLAC files). + [Fix] <js> Soft Panning check box in Mixer settings didn't work (http://bugs.openmpt.org/view.php?id=602). + [Reg] <js> Removed noSettingsOnNewVersion command line switch. It's no longer necessary as there is also a hidden setting that does the same. + +Bundled plugins + [Mod] <js> Updated PortMidi to revision 228 (fixes potential 64-bit issues). + + v1.23.05.00 (6 September 2014, revision 4238) --------------------------------------------- Pattern tab @@ -55,6 +202,11 @@ [Fix] <js> Program names starting with non-ASCII characters were not formatted properly. [Reg] <js> Partly reverted the behaviour introduced in OpenMPT 1.23.03.00 to only re-send patch numbers if they're not bank 1 patch 1, to fix legacy module playback. +Playback + [Mod] <js> When resuming paused (not stopped) playback, previously playing samples are continued. + [Fix] <js> "Maintain sample sync on seek" should now also work when playback was previously stopped. + [Fix] <js> Glissando in semitones mode didn't take finetune into account (http://bugs.openmpt.org/view.php?id=585). + IT::Compatible Playback Mode [Fix] <js> Tone portamento target is now completely cleared with new notes, so that subsequent Gxx effects have no effect. @@ -65,19 +217,14 @@ XM::Compatible Playback Mode [Fix] <js> Tentatively fix arpeggio after pitch slide behaviour (http://bugs.openmpt.org/view.php?id=542). -MOD - [Fix] <js> ProTracker applies instrument changes on the first tick, even if there's a note delay. This is now emulated in ProTracker 1/2 mode. (http://bugs.openmpt.org/view.php?id=574). - [Fix] <js> Properly implemented ProTracker-style sample swapping in ProTracker 1/2 mode, which is only supposed to happend at the end of the sample and not instantly. - [Fix] <js> Correctly handle a few more edge cases of ProTracker-style 9xx offset handling in ProTracker 1/2 mode. +MOD::ProTracker 1/2 Mode + [Fix] <js> ProTracker applies instrument changes on the first tick, even if there's a note delay (http://bugs.openmpt.org/view.php?id=574). + [Fix] <js> Properly implemented ProTracker-style sample swapping, which is only supposed to happend at the end of the sample and not instantly. + [Fix] <js> Correctly handle a few more edge cases of ProTracker-style 9xx offset handling. -Playback - [Mod] <js> When resuming paused (not stopped) playback, previously playing samples are continued. - [Fix] <js> "Maintain sample sync on seek" should now also work when playback was previously stopped. - [Fix] <js> Glissando in semitones mode didn't take finetune into account (http://bugs.openmpt.org/view.php?id=585). - -Other - [New] <jh> Add hidden setting [Misc] ShowSettingsOnNewVersion (default true) which can permanently disable showing of the settings dialog on new versions, in addition to the one-time commandline switch /noSettingsOnNewVersion . - [Imp] <js> Add support for 64-bit vorbis library builds from mingw-w64 with slightly different file names. +Misc + [New] <jh> Add hidden setting [Misc] ShowSettingsOnNewVersion (default true) which can permanently disable showing of the settings dialog on new versions, in addition to the one-time command line switch /noSettingsOnNewVersion. + [Imp] <js> Add support for 64-bit Vorbis library builds from mingw-w64 with slightly different file names. [Imp] <js> When adding a new shortcut that conflicts with an existing shortcut, do not automatically delete the existing shortcut but rather ask the user what to do. [Imp] <js> Add global dummy shortcut keybinding to prevent default keybindings from doing anything into if you don't like them (http://bugs.openmpt.org/view.php?id=550). [Imp] <js> Slightly improved icons for systems with 32-bit display mode but mysteriously missing alpha channel (http://bugs.openmpt.org/view.php?id=520). @@ -173,7 +320,6 @@ Tree view [New] <js> In the instrument library, Ctrl+Enter loads the selected instrument into the currently active sample / instrument editor window (http://bugs.openmpt.org/view.php?id=499). [Imp] <js> Ctrl+Enter starts label editing. - [Fix] <js> Duplicating samples allocated way too much memory in the previous version, which could result in crashes (http://bugs.openmpt.org/view.php?id=505). VST::Plugin Bridge [Fix] <js> Fixed KarmaFX EQ, a couple of VarietyOfSound plugins and possibly others that don't set any specific time flags, but still call audioMasterGetTime. @@ -185,8 +331,8 @@ IT::Compatible Playback Mode [Fix] <js> Sustained envelopes were released too early if the loop end was hit on exactly the same tick as the note-off event. -MOD - [Imp] <js> Added ProTracker-style offset when note but no instrument number is specified in ProTracker 1/2 mode (fixes h0ffman's Revision 2014 tracked music entry). +MOD::ProTracker 1/2 Mode + [Imp] <js> Added ProTracker-style offset when note but no instrument number is specified (fixes h0ffman's Revision 2014 tracked music entry). Module cleanup [Fix] <js> Rearranging samples broke in the previous version (http://bugs.openmpt.org/view.php?id=497). @@ -196,7 +342,7 @@ Misc [Imp] <js> All parts of the Song Properties dialog are now updated instantly when switching between formats. - [Imp] <js> Made S3M amiga frequency limits option editable from the Song Properties dialog. + [Imp] <js> Made S3M Amiga frequency limits option editable from the Song Properties dialog. [Mod] <js> Changed manual format from PDF to CHM. When opening help from certain dialogs, the relevant manual page is automatically opened. [Fix] <js> SF2 sample frequency conversion was broken in 64-bit builds (http://bugs.openmpt.org/view.php?id=508). [Fix] <js> Modifying patterns, samples, etc. should now always update other views of the same type of the same module properly. @@ -240,7 +386,7 @@ [Mod] <js> Pitch shifting and time stretching does now also work for 8-bit samples without upsampling them first. [Fix] <js> Position marks do no longer flicker and disappear when desktop compositing (and thus, Aero) is turned on. The same fix is also applied to the envelope editor, where the problem was less pronounced (http://bugs.openmpt.org/view.php?id=372). [Fix] <js> When zooming into samples longer than 32767 sampling points, it was possible that the last few points were not visible (http://bugs.openmpt.org/view.php?id=162). - [Fix] <js> Tentative fix for samples not playing completely in sample preview while song is playing - this fixes the problem only partly (http://bugs.openmpt.org/view.php?id=209). + [Fix] <js> Tentative fix for samples not playing completely in sample preview while song is playing - this fixes the problem only partly (http://bugs.openmpt.org/view.php?id=209). [Fix] <js> The zoomed-out sample display was not always accurate on CPUs with AMD MMX extensions or SSE. [Fix] <js> With sample selections > 1 second, the fractional part of the selection length was not displayed correctly. @@ -287,7 +433,7 @@ [Fix] <js> Plugin editor keyboard focus was lost after loading or saving plugin presets (http://bugs.openmpt.org/view.php?id=456). [Fix] <js> Don't add no longer existing plugins used in a module file to the list of known plugins after they have been found in the cache (http://forum.openmpt.org/index.php?topic=2304.0). [Fix] <js> Presets > 1000 can now also be selected in the plugin editor. - [Reg] <js> Removed native jBridge support in favour of our own bridge. you can still use jBrdige using the default method of plugin stubs, of course. + [Reg] <js> Removed native jBridge support in favour of our own bridge. you can still use jBridge using the default method of plugin stubs, of course. VST::Specific Plugin Fixes [Fix] <js> Poise by One Small Clue should no longer crash if the editor is still open when unloading the plugin (tx coda). @@ -354,7 +500,7 @@ Module Export [Imp] <jh> Default codec settings (per codec) and file tags are remembered. [Imp] <jh> Also show lossy codecs in pattern render to wave dialog. - [Imp] <js> Resulting file size is no longer limited to 2 GB. + [Imp] <js> Resulting file size is no longer limited to 2 GB. [Fix] <js> Export no longer fails if song starts with separator (+++) patterns (http://forum.openmpt.org/index.php?topic=5170.0). [Fix] <jh> When switching focus to a different window and then back to OpenMPT, the window became unresponsive (http://bugs.openmpt.org/view.php?id=487). @@ -369,7 +515,7 @@ [Fix] <jh> Insanely high latencies in WASAPI exclusive mode have been reduced. [Fix] <jh> Implement all driver to host messages that are required to be handled by the ASIO 2.1 specification. [Fix] <js> Fixed possible freeze during start on Windows XP during Kernel Streaming initialization (patch from http://sourceforge.net/p/audacity/mailman/message/31421748/, tx Tomoya). - + Misc [New] <js> Added (experimental) feature to add existing modules to a currently open module. This copies over all pattern, samples, instruments, plugins, etc. as far as it's possible. [New] <js> Added hidden setting for loading a default template (DefaultTemplate in [Paths] section, can be either a full path or just a filename that can be found in the template folder, http://bugs.openmpt.org/view.php?id=476). @@ -403,12 +549,12 @@ --------------------------------------------- Tree view [Fix] <js> Space key couldn't be used when editing labels. - [Fix] <jh> The global VU meter didn't work properly when previewing instruments in OpenMPT 1.22.06.00. + [Fix] <jh> The global VU meter didn't work properly when previewing instruments in OpenMPT 1.22.06.00. VST / DMO Plugins [Fix] <js> When rendering the full module (i.e. not a selection), the song position was not reset properly, so some plugins were not in sync. -Misc +Module Export [Fix] <jh> Module export to a directory or file name with non-ASCII characters could fail in OpenMPT 1.22.06.00 (http://forum.openmpt.org/index.php?topic=5158.0). @@ -559,9 +705,11 @@ MOD [Fix] <js> EEx + Dxx on the same row causes the target row of Dxx to be skipped in ProTracker (fixes condom_corruption by Travolta). [Fix] <js> When using EEx, there should be only one "first tick" event. Ticks that are multiples of the song speed are longer treated as first ticks. - [Fix] <js> Frequency limiting was not always correct in ProTracker 1.x mode (Fixes black_queen.mod). [Fix] <js> SoundTracker modules with "hidden" patterns in their order list didn't play properly anymore (probably since v1.22.03, affected e.g. Bad Dudes soundtrack). +MOD::ProTracker 1/2 Mode + [Fix] <js> Frequency limiting was not always done correctly (Fixes black_queen.mod). + Other formats [Imp] <js> AMS: Added support for reversed sample loops (starting at sample end). [Imp] <js> PTM: Note Cut and some other commands should work better, added support for effects Jxx - Mxx (note slides) and Nxx (reverse sample + offset). Some effects show up as "?" in patterns now, this does not affect playback. @@ -585,7 +733,7 @@ [Mod] <jh> Removed /nomp3 command line switch as MP3 support is now initialized on demand instead of when launching OpenMPT. [Mod] <jh> 24-/32-bit samples in DLS files are no longer normalized on load. [Fix] <js> Song Length Estimation handles some pattern loops more correctly now (http://bugs.openmpt.org/view.php?id=416). - [Fix] <js> Song Length Estimation doesn't break with some tempo slide down commands anymore (http://bugs.openmpt.org/view.php?id=416). + [Fix] <js> Song Length Estimation doesn't break with some tempo slide down commands anymore (http://bugs.openmpt.org/view.php?id=416). [Reg] <jh> Enable MMX / 3DNow! / SSE acceleration is gone. This option is now always enabled when available. [Reg] <js> Removed hidden setting ITCompressionVerification (algorithm has been proven to be stable and verification is now part of the internal test suite). @@ -728,7 +876,7 @@ [Imp] <js> Sustain loop preview is now updated instantly (http://bugs.openmpt.org/view.php?id=108). [Mod] <js> 8-Bit/Mono conversion items are now also shown in the context menu if a selection has been made. [Fix] <js> Memory was leaked when loading a sample into an empty sample slot and undoing that action. - [Fix] <js> Inserting samples did not clear previously existing sample names since some time ago. + [Fix] <js> Inserting samples didn't clear previously existing sample names since some time ago. [Fix] <js> The sample filename wasn't imported properly when loading a FLAC sample with embedded RIFF chunks. [Fix] <js> Selection length display didn't show the correct length in seconds for long samples. @@ -796,10 +944,10 @@ [Imp] <js> Added support for loading SAx panning (as found in PANIC.S3M, automatically translated to S8x panning). [Mod] <js> The channel order is now written in a L1 L2 L3... R1 R2 R3... scheme, instead of L1 R1 L2 R2 L3 R3..., so that channels are evaluated in the same order in ST3 and OpenMPT (ST3 first evaluates "left" channels, then "right" channels - note that this change does not affect the actual panning, though). -MOD - [Imp] <js> Vibrato and Tremolo are not applied on first tick anymore in ProTracker 1.x mode. - [Imp] <js> Added ProTracker arpeggio wrap-around emulation in ProTracker 1.x mode (fixes the snare sound in doh's "Jim is dead"). - [Fix] <js> In ProTracker 1.x mode, the frequency range is now limited properly by taking the sample's finetune setting into account. +MOD::ProTracker 1/2 Mode + [Imp] <js> Vibrato and Tremolo are not applied on first tick anymore.. + [Imp] <js> Added ProTracker arpeggio wrap-around emulation (fixes the snare sound in doh's "Jim is dead"). + [Fix] <js> The frequency range is now limited properly by taking the sample's finetune setting into account. MOD::Loading and Saving [Imp] <js> Drastically improved support for 15-sample (Ultimate Soundtracker and clones) modules. For example, original Ultimate Soundtracker effects are now handled much better (e.g. in sll7.mod). @@ -1307,7 +1455,7 @@ S3M [Fix] <js> Some commands (Dxy, Exx, Fxx, Ixy, Jxy, Kxy, Lxy, Qxy, Rxy, Sxy) use the last non-zero effect parameter as memory. This fixes for example Satellite One by Purple Motion. [Fix] <js> Pattern loops have no per-channel memory in ST3 (tx GreaseMonkey). - [Fix] <js> Amiga limits are now enfored correctly if the "preserve amiga limits" flag is set. + [Fix] <js> Amiga limits are now enfored correctly if the "preserve Amiga limits" flag is set. [Fix] <js> If there are multiple row delay commands on the same row, only the leftmost command is considered. [Fix] <js> Delayed notes that are on the same row as a row delay effect are be retriggered. [Reg] <js> \xx command has been removed from S3M format (existing tracks are updated automatically to use the Zxx command instead). @@ -1321,8 +1469,10 @@ MOD [Imp] <js> Rewrote MOD magic parsing code a bit; can handle anything from 1 to 99 channel MODs now. [Mod] <js> Removed MOD compatibility export, it is now always applied (but only oneshot samples are modified, and they are not modified in memory anymore). - [Fix] <js> Amiga limits are now enfored correctly in ProTracker 1.x mode. +MOD::ProTracker 1/2 Mode + [Fix] <js> Amiga limits are now enfored correctly. + Other formats [Imp] <js> Added hack-ish support for 32-bit float data to the WAV loader (the one that loads WAVs as modules, not as samples). [Imp] <js> If opening a WAV file for rendering fails, the user can choose to retry opening the file. @@ -1649,7 +1799,7 @@ [Mod] <js> Improved portamento import precision for DBM and ULT loaders (patch from Schism Tracker) [Mod] <js> Added a version check to the ITP loader (why was this not there in the first place?) [Fix] <js> As MTM files were converted to MOD automatically when being loaded, channel panning was lost. Now they're loaded as S3M instead. - [Fix] <js> Short loops in AMF / MED files are now ignored (http://bugs.openmpt.org/view.php?id=70) - probably caused by bad MOD conversions, at least in the AMF example? + [Fix] <js> Short loops in AMF / MED files are now ignored (http://bugs.openmpt.org/view.php?id=70). [Reg] <js> Disabled the Velvet Studio loader for now, since it either crashes on almost all AMS files or at least imports them completely wrong. Misc @@ -1911,11 +2061,13 @@ MOD [Imp] <js> Module creation: When creating a new .MOD, it has 31 sample slots by default. - [Imp] <js> Playback: When the ProTracker 1.x flag is activated, Amiga note range limits are automatically taken into account. [Fix] <js> Saving: Samples were shifted badly if the sample size was odd (wow, this is an OLD bug!). [Fix] <js> Saving: If a sample had loop points set, but loop disabled, they were still saved in the .MOD file, resulting in the loop being enabled automatically. [Fix] <js> Loading: Very short loops (4-8 bytes long) are not ignored anymore. This fixes "Crew Generation" by Necros. +MOD::ProTracker 1/2 Mode + [Imp] <js> Amiga note range limits are automatically taken into account. + S3M [Imp] <js> Loading: Display a message if an S3M file contains Adlib instruments (rare). [Fix] <js> In ST3, muted channels are completely ignored, not even effects are interpreted. Let's try this in MPT, too. @@ -1932,7 +2084,7 @@ [Imp] <js> MT2 Loader (MadTracker): Make use of the "lines per beat" header field. Release node is not set anymore for each and every instrument envelope. MT2 files are now loaded as IT files by default (instead of XM) because of their extended instrument properties (NNAs, filters, etc) - I wonder what this breaks, but I don't bother much because MT2 support was already 100% broken before this. :) Some MT example tunes sound a bit better now at least. [Fix] <js> PTM Loader: Fixed an unhandled null pointer exception that occured when loading some unsupported RAR files. [Fix] <js> PSM16 Loader: Fix for note cut on tick 0 (warbot tune from Silverball). - [Fix] <js> Threw out the old ULT loader in favor of Storlek's loader from SchismTracker (used with permission from the author himself). This is a lot more accurate than MPT's old loader. + [Fix] <js> Threw out the old ULT loader in favour of Storlek's loader from SchismTracker (used with permission from the author himself). This is a lot more accurate than MPT's old loader. [Fix] <js> DBM Loader: Various fixes to increase import precision and an endianness fix. [Fix] <js> AMF DSM Loader: Made some changes to the pattern reader, which eliminate the strange "vC7" commands in the pattern. I have found no hints on whether my fix is correct or not, apart from the fact that those AMF files that I have play a lot better now. And it makes kind of sense... [Fix] <js> IMF Loader: Some fixes copied from Schism (copied from MikMod). @@ -2563,7 +2715,7 @@ v1.17.02.51 (29 Mar 2008, revision 208) internal test build ----------------------------------------------------------- [New] <al> Unmute all(on transition) shortcutkeys should now work in orderlist context. - [New] <al> Half/double pattern rownumber buttons to pattern properties dialog. + [New] <al> Half / double pattern row count buttons to pattern properties dialog. [New] <al> Channel status in status bar now show channel volume info. [Mod] <al> Modified flag is not set when sliding tempo/global volume slider for MOD file. [Mod] <al> When setting instrument pan, checking whether instrument samples have set pan enabled and optionally disabling them. @@ -2571,7 +2723,7 @@ [Mod] <al> Show prev/next pattern now shows pattern over +++ orderlist items. [Mod] <al> Disabled setting channel pan for MOD/XM in general view. [Mod] <al> MIDI export won't anymore export muted channels (http://forum.openmpt.org/index.php?topic=2017.0). - [Mod] <al> When loading plug information at startup, checking whether the plug files exist (http://forum.openmpt.org/index.php?topic=1367.0). + [Mod] <al> When loading plugin information at startup, checking whether the plugin files exist (http://forum.openmpt.org/index.php?topic=1367.0). [Fix] <al> Fix to crash when loading plugins with long (> 32 characters) parameter names. [Fix] <al, ma> Fix to possible memory corruption problem on handling VST plugins with more than 30 outputs. - Plugins with more than 32 outputs might still be handled poorly. @@ -2622,7 +2774,7 @@ [Fix] <al> Fix to faulty play with certain instruments without notes in IT compatible playmode (http://forum.openmpt.org/index.php?topic=2080.0). [Fix] <al> Pattern number box didn't open pattern properties when using MPTm (http://forum.openmpt.org/index.php?topic=2073.0). [Fix] <al> Fixed wrong MIDI CC names in macro editor. - [Fix/Mod] <al> Setting volume to 0(v00) in pattern didn't necessarily set volume to 0 when using volume random variation for instrument. All other random variation behaviors are changed as well; now the 'swing' is applied directly to channel values instead of using swing addition, and by default the swing effect is reset on new note (http://forum.openmpt.org/index.php?topic=2074.0). + [Fix/Mod] <al> Setting volume to 0(v00) in pattern didn't necessarily set volume to 0 when using volume random variation for instrument. All other random variation behaviours are changed as well; now the 'swing' is applied directly to channel values instead of using swing addition, and by default the swing effect is reset on new note (http://forum.openmpt.org/index.php?topic=2074.0). v1.17.02.49 (17 Nov 2007, revision 194) internal test build @@ -2636,7 +2788,7 @@ [Mod] <al> Custom tuning related - file format changes - changed interpretation of finesteps: now zero finesteps means that finesteps are equal to notesteps, previously zero finesteps disabled portamentos etc) - - Pitch slide between notes with portamentos is now specialised also for other tuning types than just geometric(changes behavior). Previously behavior was 'geometric' for all types. + - Pitch slide between notes with portamentos is now specialised also for other tuning types than just geometric (changes behaviour). Previously behavior was 'geometric' for all types. [Fix] <al> Fixed wrong file version in IT compatibility save (http://forum.openmpt.org/index.php?topic=1723.0). [Fix] <al> Fixed possible unnotified overwriting of file occurring for example when dealing with a new file (http://forum.openmpt.org/index.php?topic=1813.0). [Fix] <al> Fixed broken note preview for certain type of instruments in instrument tab (http://forum.openmpt.org/index.php?topic=1996.0). @@ -2662,7 +2814,7 @@ v1.17.02.47 ----------- - [Mod] <al> Pattern skipping behavior returned to that of .45 + [Mod] <al> Pattern skipping behaviour returned to that of .45 [Fix] <sp> Save pattern scrollbar position when switching to other tabs. [Fix] <sp> If the cursor is moved but it is not on screen, move both horizontal and vertical scrollbars to make it visible. [Fix] <rf> Fix saturation on old modules (introduced in 1.17.02.46). Loading tracks with no saved mixlevel setting defaults to 'original'. @@ -2679,10 +2831,10 @@ [New] <al> User definable tuning modes for instruments: - Only available for MPTm - Ratio value as well as note name for every key can be assigned individually; gives rather free hands for experiments. - - Every instrument can have it's own tuning + - Every instrument can have its own tuning - Tunings can be saved to file and loaded from file. - - IMPORTANT: When using tunings, behavior of various modcommands such as portamento have been changed, and new behaviors are still to be decided. - [New] <al> In song properties, option to increase playback compatibility with original Impulse Tracker behavior. Is in no way complete; currently affects only a couple of differences. Many differences are still there. + - IMPORTANT: When using tunings, behaviour of various modcommands such as portamento have been changed, and new behaviours are still to be decided. + [New] <al> In song properties, option to increase playback compatibility with original Impulse Tracker behaviour. Is in no way complete; currently affects only a couple of differences. Many differences are still there. [New] <al> Ability to load multiple mods/samples/instruments from corresponding load dialogs. - Known issue: Intermittent failures. [New] <al> 32-bit float wav import @@ -2694,7 +2846,7 @@ [New] <rf> New mixmode (called 1.17RC3): bypass global preamp, force soft panning, provide explicit dB value for sample attenuation. WARNING: this mixmode is subject to change. [New] <rf> Check for updates on startup. To disable, set CheckForUpdates=0 in mptrack.ini. [Mod] <al> Channel states resetting when jumping between orders from orderlist. - - NOTE: While this fixes a bug (behavior change) introduced in the tuning branch(?), it also changes quite prominent behavior so can annoy people - might need to be modified at some point. + - NOTE: While this fixes a bug (behaviour change) introduced in the tuning branch(?), it also changes quite prominent behaviour so can annoy people - might need to be modified at some point. [Mod] <al> Added version number to the mainframe title. [Mod] <al> Changed the 'order message' at the bottom bar of the screen "Position x of y" to "Position x of y (x in hex of y in hex)". [Mod] <al> Lots of smaller (internal) changes. @@ -2703,7 +2855,7 @@ [Fix] <rf> Fix odd window position on very first startup (before mptrack.ini is created). [Fix] <al> When opening instruments, load dialog didn't remember its previous path. [Fix] <al> In general tab, it was possible to give longer modname than the fileformat could save. - [Fix] <al> Instruments associates with VSTis no longer also need to be associated to a sample in order to play. + [Fix] <al> Instruments associated with VSTis no longer also need to be associated to a sample in order to play. [Fix] <al> Trash characters to empty ITP comments should no longer appear. [Fix] <al> Channel state should now be updated correctly when e.g. moving channels through channel manager. [Fix] <al> It should no longer be possible to remove all channels from channel manager. @@ -2963,7 +3115,7 @@ - Known issue: orderlist GUI is not refreshed so line remains. [Mod] <rf> Enabled XP themes. [Mod] <rf> Resolution of plugin default GUI parameter slider increased from 100 to 1000. I couldn't get the per-thousand symbol to display yet. :( - [Mod] <rf> Version number change - we no longer specify revision number explicitly. It is bad practice to make revision numbers external, as we have no real control over the way they change. The version number will always be in the CVS-commit comments fiel from now on. + [Mod] <rf> Version number change - we no longer specify revision number explicitly. It is bad practice to make revision numbers external, as we have no real control over the way they change. The version number will always be in the CVS-commit comments field from now on. [Mod] <rf> GUI now uses radiobuttons for path type selection. [Mod] <rf> Toggle (un)mute on pattern transition is now ctrl-left-click (not ctrl-right-click). [Mod] <rf> Song settings dialog cleanup. Minor instrument tab GUI cleanups. About dialog cleanups. Added: trunk/OpenMPT/packageTemplate/OMPT_1.24_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.24_ReleaseNotes.html (rev 0) +++ trunk/OpenMPT/packageTemplate/OMPT_1.24_ReleaseNotes.html 2014-12-21 00:35:49 UTC (rev 4662) @@ -0,0 +1,205 @@ +<?xml version="1.0" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title>OpenMPT 1.24 Release Notes</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta name="language" content="en" /> + <style type="text/css"> + * { font-family: Calibri, sans-serif; } + body + { + color: #222; + background: #eee; + font-size: 13pt; + margin: 0 0 1em 0; + padding: 0; + border: none; + } + + a { color: #b30; text-decoration: none; } + a:visited { color: #910; text-decoration: none; } + a:hover { text-decoration: underline; } + + .screenshots + { + float:right; + text-align:right; + } + + .screenshots img, h1 + { + border: 1px solid #ccc; + padding: 3px; + background: #f0f0f0; + margin: 0 0 3px 3px; + } + + p { margin: 0.5em 1em; padding: 0; } + + h1 + { + margin: 0 0 1em 0; + padding: 10px; + font-size: 24pt; + color: #444; + text-shadow: 1px 1px 1px #999; + background: #ddd; + background-image: linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -o-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -moz-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -webkit-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -ms-linear-gradient(bottom, #ddd 20%, #eee 60%); + background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.2, #ddd), color-stop(0.6, #eee)); + border-width: 0 0 1px 0; + } + + h1 img { vertical-align: middle; margin-right: 1em; } + + h2, h3, h4 + { + border: 1px solid #ccc; + border-width: 0 0 0 3em; + margin: 1em 0.5em; + padding: 0px 5px; + font-size: 18pt; + color: #333; + text-shadow: 1px 1px #fff; + } + + h3 { border-left-width: 2em; } + h4 { border-left-width: 1em; } + + li {list-style-type: none; padding: 0 0 0.5em 0; } + li:before { content: "» "; } + + li li { padding: 0; } + + /* use this for pattern data */ + pre + { + font-family: monospace; + display: inline; + color: #006; + } + + tt + { + font-family: monospace; + } + + </style> + </head> + <body> + + <h1> + <img src="ReleaseNotesImages/general/modplug.png" width="81" height="80" alt="OpenMPT Logo" /> + OpenMPT 1.24 - Release Notes + </h1> + + <p> + It's been a while since the last official release (version 1.23.05.00), and we have been working on a bunch of great new features for this new version. + This document should give a rough overview about the greatest changes in OpenMPT 1.24. + </p> + + <h2>What's new?</h2> + + <h3>General</h3> + <div class="screenshots"> + <a href="ReleaseNotesImages/1.24/missingsamples.png"><img src="ReleaseNotesImages/1.24/missingsamples.png" width="255" height="173" alt="Missing Samples Dialog" title="Missing Samples Dialog" /></a> <br /> + <a href="ReleaseNotesImages/1.24/midimapping.png"><img src="ReleaseNotesImages/1.24/midimapping.png" width="255" height="173" alt="MIDI Mapping Dialog" title="MIDI Mapping Dialog" /></a> + </div> + <ul> + <li><strong>ITP is dead</strong>, long live MPTM! No worries, your old ITP files can still be imported, but the clunky ITP format has been dropped in favour of some new features in the MPTM format: Instead of instruments, you can now keep references to <strong>external samples</strong> in your MPTM files, effectively reducing the file size even if a sample is shared by several instruments. The ITI instrument format has been extended in a similar way so that ITI files can now simply reference external sample files instead of directly embedding the sample data. Unlike in the ITP format, it is easy to mix external and internal samples in one file and relocate missing files.</li> + <li>Each song's <strong>window position and contents</strong> are now saved, so that you can continue right where you left off when reloading the file.</li> + <li>"Remove unused sample data" now also finds samples with <strong>identical stereo channels</strong> and offers to optimize them to mono.</li> + <li><strong>Dropping a folder</strong> on OpenMPT that contains modules or VST plugins opens / registers them directly now.</li> + <li>Song length estimation can now show the length of all <strong>"hidden" subtunes</strong> in the current sequence.</li> + <li>Many small improvements in the audio output code again, also to improve performance on Wine systems.</li> + <li>Made the <strong>MIDI Mapping dialog</strong>'s mapping list more human-readable.</li> + </ul> + + <h3>Pattern Editor</h3> + <ul> + <li>Ctrl+(Shift+)<strong>Scroll wheel</strong> can now be used as a replacement for the "(Coarse) Data Entry" shortcuts.</li> + </ul> + + <h3>Tree view</h3> + <ul> + <li>Further enhanced <strong>drag&drop</strong> functionality: Dropping a module or folder on the sample browser opens this module or folder for browsing, dropping a soundfont file on the upper part of the tree view adds it to the list of soundfonts.</li> + <li>Due to the change from external instruments in the ITP format to external samples in MPTM, "Set Path" and "Save" have been moved to samples. External samples are marked with [external], missing external samples are marked with [missing].</li> + <li>Sample waveforms can now be <strong>reloaded from disk</strong> (e.g. after editing a sample in an external application) if OpenMPT knows the sample's original path, e.g. after loading or saving it, or using MPTM's external sample feature.</li> + </ul> + + <h3>Plugins</h3> + <ul> + <li>When adding a new plugin through the plugin manager that is <strong>missing from some open file</strong>, it is now automatically loaded and restored in that file.</li> + <li>"Randomize Parameters" now applies a <strong>customizable randomization factor</strong> - much more useful than completely random parameters.</li> + </ul> + + <h3>Sample Editor</h3> + <ul> + <li><strong>Resampling</strong> to any custom sample rate is now possible, thanks to the high-quality r8brain-free resampler.</li> + <li><strong>Adjusting the sample frequency</strong> updates all playing notes' sample frequency immediately (only in IT and MPTM).</li> + <li><strong>Custom background</strong> and selection colours.</li> + <li><strong>Rearranging samples</strong> (e.g. through song cleanup or the tree view) no longer messes up the undo buffer history.</li> + </ul> + + <h3>Instrument Editor</h3> + <ul> + <li>ITI instrument files can now contain <strong>external samples</strong> (like MPTM files, see above). Select "Impulse Tracker Instruments with external Samples" from the save dialog.</li> + <li>When previewing instruments with a fadeout value of 0, instantly stop them on key-up instead of letting them play forever.</li> + <li>The first instrument of a <strong>soundfont can now be loaded directly</strong> without registering the soundfont in OpenMPT. Useful for single-instrument soundfonts.</li> + </ul> + + <h3>Playback</h3> + <p> + A couple of playback behaviours have been changed and improved: + </p> + <ul> + <li>S70 / S71 / S72 commands do now <strong>also work with instrument plugins</strong>. NNA / DCA settings are now applied to plugins assigned to sample-less instruments as well.</li> + <li><strong>Smooth MIDI macros</strong> do now, to some extent, work with external MIDI messages. They interpolate from the previous Zxx or \xx parameter from the same channel to the new parameter.</li> + <li>In all mix modes since 1.17RC2, a way too long volume ramp (some times up to 100 times longer than the user-supplied ramp setup) was applied for extreme global volume changes. This is now disabled except for legacy 1.17RC2 mix mode.</li> + <li>Re-implemented <strong>stereo separation</strong> to be applied on the master mix. This means that it also works as expected with stereo samples and plugins now.</li> + <li><strong>Linear frequency slide</strong> mode (in all formats except XM, which already worked as intended) has been re-implemented to fix some unwanted inaccuracies which can add up very quickly when using extra-fine slides.</li> + </ul> + + <h3>File Format Support</h3> + <ul> + <li>Reverted <strong>XM compatibility export</strong> to always write out 256 order items, which should restore compatibility with a couple of players that were previously choking on OpenMPT's XM files.</li> + <li>Use "normal" compatible mix mode instead of FT2 panning mix mode for XM files that were compatibility-exported with OpenMPT 1.22 or older, and XM files made with other trackers that use linear panning.</li> + <li><strong>Compatible playback mode for S3M</strong>: When enabled, OpenMPT emulates certain ScreamTracker quirks as it did until now (linked pattern effect memory and ignored effects on muted channels). Compatible mode is disabled automatically for files made with less compatible trackers. S3M files made with OpenMPT always have this mode enabled, and its state is not saved in S3M files.</li> + <li><strong>Amiga frequency limits</strong> can now also be enforced in MOD files without activating ProTracker 1/2 mode.</li> + <li>Added loading support for a MOD variant introduced by <strong>SoundTracker 2.6 and Ice Tracker</strong>.</li> + <li>Completely <strong>rewrote MT2 loader</strong>. Some files that would previously not load properly do now load. Support for VST plugins, drum patterns and some extended MT2 pattern commands has been added.</li> + </ul> + + <h3>There's more...</h3> + <p> + For a detailed description of what has changed, check <a href="History.txt">History.txt</a>. If you are new to OpenMPT, be sure to read the manual as well. + </p> + + <h2>Known Issues</h2> + <p> + <i>This list has mostly been copied over from the old OpenMPT 1.17 RC2 release notes, so this not very comprehensive... :-)</i> + </p> + <ul> + <li>The plugin bridge is new and hasn't been tested very much yet. It is known that some plugins don't work in it at all. Custom plugin GUIs are known to not work in Wine. Please report any other issues you may be having with the plugin bridge!</li> + <li>Far from perfect VST support (no buses for audio / MIDI routing, only a few tracker effects are supported, etc...)</li> + <li>Previewing samples from the tree view's file browser stops the playing module.</li> + <li>Cannot preview soundfont instruments directly from the MIDI Library in the tree view.</li> + <li>Excessive performance drop when dragging over the graphical parameter editor during playback.</li> + <li>The Right Alt (or Alt Gr) key is not handled well by the keyboard configuration.</li> + <li>There is no really <em>convenient</em> way to find out what features of the tracker are supported by the original trackers (Impulse Tracker, Fasttracker 2, etc...) when working with those file formats...</li> + </ul> + + <h2>Contact</h2> + <p> + Helpful bug reports, new ideas and brave volunteers to test early development builds or contribute to the code are more than welcome!<br /> + Our issue tracker is located at <a href="http://bugs.openmpt.org/">http://bugs.openmpt.org/</a> and can be used to report bugs and feature requests.<br /> + You can also meet us at the ModPlug Central forums: <a href="http://forum.openmpt.org/">http://forum.openmpt.org/</a>. + </p> + + </body> +</html> \ No newline at end of file Property changes on: trunk/OpenMPT/packageTemplate/OMPT_1.24_ReleaseNotes.html ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/html \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24 =================================================================== --- trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24 2014-12-20 20:06:32 UTC (rev 4661) +++ trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24 2014-12-21 00:35:49 UTC (rev 4662) Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24 ___________________________________________________________________ Added: tsvn:logminsize ## -0,0 +1 ## +10 \ No newline at end of property Added: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/midimapping.png =================================================================== (Binary files differ) Index: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/midimapping.png =================================================================== --- trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/midimapping.png 2014-12-20 20:06:32 UTC (rev 4661) +++ trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/midimapping.png 2014-12-21 00:35:49 UTC (rev 4662) Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/midimapping.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +image/png \ No newline at end of property Added: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/missingsamples.png =================================================================== (Binary files differ) Index: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/missingsamples.png =================================================================== --- trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/missingsamples.png 2014-12-20 20:06:32 UTC (rev 4661) +++ trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/missingsamples.png 2014-12-21 00:35:49 UTC (rev 4662) Property changes on: trunk/OpenMPT/packageTemplate/ReleaseNotesImages/1.24/missingsamples.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +image/png \ No newline at end of property Modified: trunk/OpenMPT/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/packageTemplate/readme.txt 2014-12-20 20:06:32 UTC (rev 4661) +++ trunk/OpenMPT/packageTemplate/readme.txt 2014-12-21 00:35:49 UTC (rev 4662) @@ -1,5 +1,5 @@ ****************** -* OpenMPT 1.23 * +* OpenMPT 1.24 * ****************** @@ -68,7 +68,7 @@ OpenMPT_SoundTouch_f32.dll: SoundTouch library used in time stretching feature. readme.txt: This document unmo3.dll: Used in MO3-file import. -OMPT_1.23_ReleaseNotes.html: Release notes for this version. +OMPT_1.24_ReleaseNotes.html: Release notes for this version. License This was sent by the SourceFor... [truncated message content] |
From: <man...@us...> - 2014-12-21 08:29:23
|
Revision: 4664 http://sourceforge.net/p/modplug/code/4664 Author: manxorist Date: 2014-12-21 08:29:05 +0000 (Sun, 21 Dec 2014) Log Message: ----------- [Doc] libopenmpt: Update changelog for -beta8. [Mod] build: Update libopenmpt libtool version. Modified Paths: -------------- trunk/OpenMPT/build/autotools/Makefile.am trunk/OpenMPT/libopenmpt/dox/changelog.md Modified: trunk/OpenMPT/build/autotools/Makefile.am =================================================================== --- trunk/OpenMPT/build/autotools/Makefile.am 2014-12-21 00:37:39 UTC (rev 4663) +++ trunk/OpenMPT/build/autotools/Makefile.am 2014-12-21 08:29:05 UTC (rev 4664) @@ -66,7 +66,7 @@ pkgconfig_DATA += libopenmpt/libopenmpt.pc lib_LTLIBRARIES += libopenmpt.la -libopenmpt_la_LDFLAGS = -version-info 0:7:0 +libopenmpt_la_LDFLAGS = -version-info 0:8:0 nobase_include_HEADERS += libopenmpt/libopenmpt.h libopenmpt/libopenmpt.hpp libopenmpt/libopenmpt_version.h libopenmpt/libopenmpt_config.h libopenmpt/libopenmpt_stream_callbacks_fd.h libopenmpt/libopenmpt_stream_callbacks_file.h libopenmpt/libopenmpt_ext.hpp libopenmpt_la_CPPFLAGS = -DLIBOPENMPT_BUILD -I$(srcdir)/build/svn_version -I$(srcdir)/ -I$(srcdir)/common $(ZLIB_CFLAGS) $(LTDL_CPPFLAGS) libopenmpt_la_CXXFLAGS = $(ZLIB_CFLAGS) Modified: trunk/OpenMPT/libopenmpt/dox/changelog.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/changelog.md 2014-12-21 00:37:39 UTC (rev 4663) +++ trunk/OpenMPT/libopenmpt/dox/changelog.md 2014-12-21 08:29:05 UTC (rev 4664) @@ -5,11 +5,13 @@ For fully detailed change log, please see the source repository directly. This is just a high-level summary. -### libopenmpt svn +### 2014-12-21 - libopenmpt 0.2-beta8 * foo_openmpt: Settings are now accessable via foobar2000 advanced settings. * Autotools based build now supports libunmo3. Specify --enable-unmo3. * Support for dynamic loading of libunmo3 on MacOS X. + * libopenmpt now uses libltld (from libtool) for dynamic loading of libunmo3 + on all non-Windows platforms. * Support for older compilers: * GCC 4.1.x to 4.3.x (use `make ANCIENT=1`) * Microsoft Visual Studio 2008 (with latest Service Pack) @@ -22,6 +24,7 @@ * [Bug] The -autotools tarballs were not working at all. * Vastly improved MT2 loader. + * Improved S3M playback compatibility. * Added openmpt::ext::interactive, an extension which adds a whole bunch of new functionality to change playback in some way or another. * Added possibility to sync sample playback when using This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-12-21 10:00:13
|
Revision: 4667 http://sourceforge.net/p/modplug/code/4667 Author: manxorist Date: 2014-12-21 10:00:06 +0000 (Sun, 21 Dec 2014) Log Message: ----------- [Doc] libopenmpt: Update changelog for -beta9. [Mod] build: Update libopenmpt libtool version. Modified Paths: -------------- trunk/OpenMPT/build/autotools/Makefile.am trunk/OpenMPT/libopenmpt/dox/changelog.md Modified: trunk/OpenMPT/build/autotools/Makefile.am =================================================================== --- trunk/OpenMPT/build/autotools/Makefile.am 2014-12-21 09:59:33 UTC (rev 4666) +++ trunk/OpenMPT/build/autotools/Makefile.am 2014-12-21 10:00:06 UTC (rev 4667) @@ -66,7 +66,7 @@ pkgconfig_DATA += libopenmpt/libopenmpt.pc lib_LTLIBRARIES += libopenmpt.la -libopenmpt_la_LDFLAGS = -version-info 0:8:0 +libopenmpt_la_LDFLAGS = -version-info 0:9:0 nobase_include_HEADERS += libopenmpt/libopenmpt.h libopenmpt/libopenmpt.hpp libopenmpt/libopenmpt_version.h libopenmpt/libopenmpt_config.h libopenmpt/libopenmpt_stream_callbacks_fd.h libopenmpt/libopenmpt_stream_callbacks_file.h libopenmpt/libopenmpt_ext.hpp libopenmpt_la_CPPFLAGS = -DLIBOPENMPT_BUILD -I$(srcdir)/build/svn_version -I$(srcdir)/ -I$(srcdir)/common $(ZLIB_CFLAGS) $(LTDL_CPPFLAGS) libopenmpt_la_CXXFLAGS = $(ZLIB_CFLAGS) Modified: trunk/OpenMPT/libopenmpt/dox/changelog.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/changelog.md 2014-12-21 09:59:33 UTC (rev 4666) +++ trunk/OpenMPT/libopenmpt/dox/changelog.md 2014-12-21 10:00:06 UTC (rev 4667) @@ -5,6 +5,10 @@ For fully detailed change log, please see the source repository directly. This is just a high-level summary. +### 2014-12-21 - libopenmpt 0.2-beta9 + + * [Bug] libopenmpt_ext.hpp was missing from the Windows binary zip files. + ### 2014-12-21 - libopenmpt 0.2-beta8 * foo_openmpt: Settings are now accessable via foobar2000 advanced settings. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-12-21 18:18:41
|
Revision: 4670 http://sourceforge.net/p/modplug/code/4670 Author: saga-games Date: 2014-12-21 18:18:28 +0000 (Sun, 21 Dec 2014) Log Message: ----------- [Fix] The Parameter Editor refused to work under random conditions (always when just visualizing one row, but also sometimes when visualizing more rows) [Mod] OpenMPT: Version is now 1.24.01.01 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/EffectVis.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-12-21 15:57:15 UTC (rev 4669) +++ trunk/OpenMPT/common/versionNumber.h 2014-12-21 18:18:28 UTC (rev 4670) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 24 #define VER_MINOR 01 -#define VER_MINORMINOR 00 +#define VER_MINORMINOR 01 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/EffectVis.cpp =================================================================== --- trunk/OpenMPT/mptrack/EffectVis.cpp 2014-12-21 15:57:15 UTC (rev 4669) +++ trunk/OpenMPT/mptrack/EffectVis.cpp 2014-12-21 18:18:28 UTC (rev 4670) @@ -2,7 +2,7 @@ * EffectVis.cpp * ------------- * Purpose: Implementation of parameter visualisation dialog. - * Notes : (currently none) + * Notes : TODO: Take DPI scaling into account. * Authors: OpenMPT Devs * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. */ @@ -550,7 +550,10 @@ m_cmbEffectList.SetWindowPos(this, m_rcFullWin.right-COMMANDLISTWIDTH, m_rcDraw.bottom, COMMANDLISTWIDTH, m_rcFullWin.bottom-m_rcDraw.bottom, SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_SHOWWINDOW|SWP_NOZORDER); - m_pixelsPerRow = (float)(m_rcDraw.Width()-INNERLEFTBORDER-INNERRIGHTBORDER)/(float)m_nRows; + if(m_nRows) + m_pixelsPerRow = (float)(m_rcDraw.Width()-INNERLEFTBORDER-INNERRIGHTBORDER)/(float)m_nRows; + else + m_pixelsPerRow = 1; m_pixelsPerFXParam = (float)(m_rcDraw.Height())/(float)0xFF; m_pixelsPerPCParam = (float)(m_rcDraw.Height())/(float)ModCommand::maxColumnValue; m_boolForceRedraw = TRUE; @@ -604,7 +607,10 @@ m_endRow = m_pSndFile->Patterns[m_nPattern].GetNumRows() - 1; } - m_pixelsPerRow = (float)(m_rcDraw.Width()-INNERLEFTBORDER-INNERRIGHTBORDER) / (float)m_nRows; + if(m_nRows) + m_pixelsPerRow = (float)(m_rcDraw.Width()-INNERLEFTBORDER-INNERRIGHTBORDER) / (float)m_nRows; + else + m_pixelsPerRow = 1; m_pixelsPerFXParam = (float)(m_rcDraw.Height())/(float)0xFF; m_pixelsPerPCParam = (float)(m_rcDraw.Height())/(float)ModCommand::maxColumnValue; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-12-24 09:27:03
|
Revision: 4674 http://sourceforge.net/p/modplug/code/4674 Author: manxorist Date: 2014-12-24 09:26:47 +0000 (Wed, 24 Dec 2014) Log Message: ----------- [Ref] SoundDevice::StopMode does not directly influence the behaviour of a sound device. Instead, it determines how the devices get used by the tracker. Rename it to SoundDeviceStopMode and move it from sounddev/SoundDevice.h to mptrack/TrackerSettings.h . Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/sounddev/SoundDevice.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2014-12-24 09:26:47 UTC (rev 4674) @@ -1201,7 +1201,7 @@ m_NotifyTimer = 0; } ResetNotificationBuffer(); - if(!gpSoundDevice->GetDeviceCaps().CanKeepDeviceRunning || TrackerSettings::Instance().m_SoundSettingsStopMode == SoundDevice::StopModeClosed) + if(!gpSoundDevice->GetDeviceCaps().CanKeepDeviceRunning || TrackerSettings::Instance().m_SoundSettingsStopMode == SoundDeviceStopModeClosed) { audioCloseDevice(); } @@ -1649,8 +1649,8 @@ } -BOOL CMainFrame::SetupSoundCard(SoundDevice::Settings deviceSettings, SoundDevice::Identifier deviceIdentifier, SoundDevice::StopMode stoppedMode, bool forceReset) -//----------------------------------------------------------------------------------------------------------------------------------------------------------------- +BOOL CMainFrame::SetupSoundCard(SoundDevice::Settings deviceSettings, SoundDevice::Identifier deviceIdentifier, SoundDeviceStopMode stoppedMode, bool forceReset) +//--------------------------------------------------------------------------------------------------------------------------------------------------------------- { MPT_TRACE(); if(forceReset @@ -1672,13 +1672,13 @@ TrackerSettings::Instance().m_SoundSettingsStopMode = stoppedMode; switch(stoppedMode) { - case SoundDevice::StopModeClosed: + case SoundDeviceStopModeClosed: deviceSettings.KeepDeviceRunning = true; break; - case SoundDevice::StopModeStopped: + case SoundDeviceStopModeStopped: deviceSettings.KeepDeviceRunning = false; break; - case SoundDevice::StopModePlaying: + case SoundDeviceStopModePlaying: deviceSettings.KeepDeviceRunning = true; break; } Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2014-12-24 09:26:47 UTC (rev 4674) @@ -512,7 +512,7 @@ void IdleHandlerSounddevice(); BOOL ResetSoundCard(); - BOOL SetupSoundCard(SoundDevice::Settings deviceSettings, SoundDevice::Identifier deviceIdentifier, SoundDevice::StopMode stoppedMode, bool forceReset = false); + BOOL SetupSoundCard(SoundDevice::Settings deviceSettings, SoundDevice::Identifier deviceIdentifier, SoundDeviceStopMode stoppedMode, bool forceReset = false); BOOL SetupMiscOptions(); BOOL SetupPlayer(); Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-12-24 09:26:47 UTC (rev 4674) @@ -870,7 +870,7 @@ m_Settings.ChannelMapping = SoundDevice::ChannelMapping(); } } - CMainFrame::GetMainFrame()->SetupSoundCard(m_Settings, m_CurrentDeviceInfo.GetIdentifier(), (SoundDevice::StopMode)m_CbnStoppedMode.GetCurSel()); + CMainFrame::GetMainFrame()->SetupSoundCard(m_Settings, m_CurrentDeviceInfo.GetIdentifier(), (SoundDeviceStopMode)m_CbnStoppedMode.GetCurSel()); SetDevice(m_CurrentDeviceInfo.GetIdentifier(), true); // Poll changed ASIO sample format and channel names UpdateDevice(); UpdateStatistics(); Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-24 09:26:47 UTC (rev 4674) @@ -171,7 +171,7 @@ , m_SoundSampleRates(conf, "Sound Settings", "SampleRates", GetDefaultSampleRates()) , m_MorePortaudio(conf, "Sound Settings", "MorePortaudio", false) , m_SoundSettingsOpenDeviceAtStartup(conf, "Sound Settings", "OpenDeviceAtStartup", false) - , m_SoundSettingsStopMode(conf, "Sound Settings", "StopMode", SoundDevice::StopModeClosed) + , m_SoundSettingsStopMode(conf, "Sound Settings", "StopMode", SoundDeviceStopModeClosed) , m_SoundDeviceSettingsUseOldDefaults(false) , m_SoundDeviceID_DEPRECATED(SoundDevice::ID()) , m_SoundDeviceIdentifier(conf, "Sound Settings", "Device", SoundDevice::Identifier()) @@ -390,10 +390,10 @@ { if(conf.Read<bool>("Sound Settings", "KeepDeviceOpen", false)) { - m_SoundSettingsStopMode = SoundDevice::StopModePlaying; + m_SoundSettingsStopMode = SoundDeviceStopModePlaying; } else { - m_SoundSettingsStopMode = SoundDevice::StopModeStopped; + m_SoundSettingsStopMode = SoundDeviceStopModeStopped; } } if(storedVersion < MAKE_VERSION_NUMERIC(1,22,07,04)) Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-24 09:26:47 UTC (rev 4674) @@ -310,13 +310,20 @@ return dfFLAC; } -template<> inline SettingValue ToSettingValue(const SoundDevice::StopMode &val) +enum SoundDeviceStopMode { + SoundDeviceStopModeClosed = 0, + SoundDeviceStopModeStopped = 1, + SoundDeviceStopModePlaying = 2, +}; + +template<> inline SettingValue ToSettingValue(const SoundDeviceStopMode &val) +{ return SettingValue(static_cast<int32>(val)); } -template<> inline SoundDevice::StopMode FromSettingValue(const SettingValue &val) +template<> inline SoundDeviceStopMode FromSettingValue(const SettingValue &val) { - return static_cast<SoundDevice::StopMode>(static_cast<int32>(val)); + return static_cast<SoundDeviceStopMode>(static_cast<int32>(val)); } @@ -376,7 +383,7 @@ Setting<std::vector<uint32> > m_SoundSampleRates; Setting<bool> m_MorePortaudio; Setting<bool> m_SoundSettingsOpenDeviceAtStartup; - Setting<SoundDevice::StopMode> m_SoundSettingsStopMode; + Setting<SoundDeviceStopMode> m_SoundSettingsStopMode; bool m_SoundDeviceSettingsUseOldDefaults; SoundDevice::ID m_SoundDeviceID_DEPRECATED; Modified: trunk/OpenMPT/sounddev/SoundDevice.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.h 2014-12-23 19:11:09 UTC (rev 4673) +++ trunk/OpenMPT/sounddev/SoundDevice.h 2014-12-24 09:26:47 UTC (rev 4674) @@ -285,14 +285,6 @@ }; -enum StopMode -{ - StopModeClosed = 0, - StopModeStopped = 1, - StopModePlaying = 2, -}; - - struct Settings { HWND hWnd; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-12-24 12:10:41
|
Revision: 4676 http://sourceforge.net/p/modplug/code/4676 Author: manxorist Date: 2014-12-24 12:10:21 +0000 (Wed, 24 Dec 2014) Log Message: ----------- [Ref] Replace MPT_GET_COMPONENT(foo) with GetComponent<foo>(). Modified Paths: -------------- trunk/OpenMPT/common/ComponentManager.h trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/soundlib/Load_mo3.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp Modified: trunk/OpenMPT/common/ComponentManager.h =================================================================== --- trunk/OpenMPT/common/ComponentManager.h 2014-12-24 09:35:42 UTC (rev 4675) +++ trunk/OpenMPT/common/ComponentManager.h 2014-12-24 12:10:21 UTC (rev 4676) @@ -279,6 +279,8 @@ }; bool ComponentListPush(ComponentListEntry *entry); + +#define MPT_DECLARE_COMPONENT_MEMBERS public: static const char * const g_TypeName; #define MPT_REGISTERED_COMPONENT(name) \ static void RegisterComponent ## name (ComponentManager *componentManager) \ @@ -286,23 +288,23 @@ componentManager->Register(ComponentFactory< name >( #name )); \ } \ static ComponentListEntry Component ## name ## ListEntry = { nullptr, & RegisterComponent ## name }; \ - static bool Component ## name ## Registered = ComponentListPush(& Component ## name ## ListEntry ); + static bool Component ## name ## Registered = ComponentListPush(& Component ## name ## ListEntry ); \ + const char * const name :: g_TypeName = #name ; \ /**/ template <typename type> -MPT_SHARED_PTR<type> GetComponent(const std::string &name) +MPT_SHARED_PTR<type> GetComponent() { - return MPT_DYNAMIC_POINTER_CAST<type>(ComponentManager::Instance()->GetComponent(ComponentFactory<type>(name))); + return MPT_DYNAMIC_POINTER_CAST<type>(ComponentManager::Instance()->GetComponent(ComponentFactory<type>(type::g_TypeName))); } -#define MPT_GET_COMPONENT(name) GetComponent< name >( #name ) +#else // !MPT_COMPONENT_MANAGER -#else // !MPT_COMPONENT_MANAGER +#define MPT_DECLARE_COMPONENT_MEMBERS - #define MPT_REGISTERED_COMPONENT(name) @@ -319,9 +321,6 @@ } -#define MPT_GET_COMPONENT(name) GetComponent< name >() - - #endif // MPT_COMPONENT_MANAGER Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-12-24 09:35:42 UTC (rev 4675) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-12-24 12:10:21 UTC (rev 4676) @@ -1803,6 +1803,7 @@ //======================= : public ComponentDelayLoadedBundledDLL { + MPT_DECLARE_COMPONENT_MEMBERS public: ComponentSoundTouch() : ComponentDelayLoadedBundledDLL(MPT_PATHSTRING("OpenMPT_SoundTouch_f32")) @@ -1832,7 +1833,7 @@ if(pitch > 2.0f) return 2 + (2<<8); // Check whether the DLL file exists. - MPT_SHARED_PTR<ComponentSoundTouch> soundTouch = MPT_GET_COMPONENT(ComponentSoundTouch); + MPT_SHARED_PTR<ComponentSoundTouch> soundTouch = GetComponent<ComponentSoundTouch>(); if(!IsComponentAvailable(soundTouch)) { MsgBox(IDS_SOUNDTOUCH_LOADFAILURE); Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2014-12-24 09:35:42 UTC (rev 4675) +++ trunk/OpenMPT/mptrack/Mptrack.h 2014-12-24 12:10:21 UTC (rev 4676) @@ -149,6 +149,7 @@ class ComponentUXTheme : public ComponentSystemDLL { + MPT_DECLARE_COMPONENT_MEMBERS public: ComponentUXTheme() : ComponentSystemDLL(MPT_PATHSTRING("uxtheme"), true) { } std::string GetSettingsKey() const { return "UXTheme"; } Modified: trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp 2014-12-24 09:35:42 UTC (rev 4675) +++ trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp 2014-12-24 12:10:21 UTC (rev 4676) @@ -258,6 +258,8 @@ : public ComponentBase { + MPT_DECLARE_COMPONENT_MEMBERS + public: const char* (CDECL * get_lame_version)(); @@ -646,6 +648,8 @@ : public ComponentBase { + MPT_DECLARE_COMPONENT_MEMBERS + public: bool isLame; @@ -916,6 +920,8 @@ : public ComponentBase { + MPT_DECLARE_COMPONENT_MEMBERS + public: bool found_codec; @@ -1430,7 +1436,7 @@ #ifdef MPT_MP3ENCODER_LAME if(type == MP3EncoderDefault || type == MP3EncoderLame) { - m_Lame = MPT_GET_COMPONENT(ComponentLame); + m_Lame = GetComponent<ComponentLame>(); if(IsComponentAvailable(m_Lame)) { m_Type = MP3EncoderLame; @@ -1442,7 +1448,7 @@ #ifdef MPT_MP3ENCODER_BLADE if(type == MP3EncoderDefault || type == MP3EncoderBlade) { - m_Blade = MPT_GET_COMPONENT(ComponentBlade); + m_Blade = GetComponent<ComponentBlade>(); if(IsComponentAvailable(m_Blade)) { m_Type = MP3EncoderBlade; @@ -1454,7 +1460,7 @@ #ifdef MPT_MP3ENCODER_ACM if(type == MP3EncoderDefault || type == MP3EncoderACM) { - m_Acm = MPT_GET_COMPONENT(ComponentAcmMP3); + m_Acm = GetComponent<ComponentAcmMP3>(); if(IsComponentAvailable(m_Acm)) { m_Type = MP3EncoderACM; Modified: trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp 2014-12-24 09:35:42 UTC (rev 4675) +++ trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp 2014-12-24 12:10:21 UTC (rev 4676) @@ -44,6 +44,8 @@ : public ComponentBase { + MPT_DECLARE_COMPONENT_MEMBERS + public: // ogg @@ -566,7 +568,7 @@ OggOpusEncoder::OggOpusEncoder() //------------------------------ { - m_Opus = MPT_GET_COMPONENT(ComponentOpus); + m_Opus = GetComponent<ComponentOpus>(); if(IsComponentAvailable(m_Opus)) { SetTraits(m_Opus->BuildTraits()); Modified: trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp 2014-12-24 09:35:42 UTC (rev 4675) +++ trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp 2014-12-24 12:10:21 UTC (rev 4676) @@ -29,6 +29,8 @@ : public ComponentBase { + MPT_DECLARE_COMPONENT_MEMBERS + public: // ogg @@ -397,7 +399,7 @@ VorbisEncoder::VorbisEncoder() //---------------------------- { - m_Vorbis = MPT_GET_COMPONENT(ComponentVorbis); + m_Vorbis = GetComponent<ComponentVorbis>(); if(IsComponentAvailable(m_Vorbis)) { SetTraits(m_Vorbis->BuildTraits()); Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2014-12-24 09:35:42 UTC (rev 4675) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2014-12-24 12:10:21 UTC (rev 4676) @@ -1579,7 +1579,7 @@ { case CTLCOLOR_DLG: { - MPT_SHARED_PTR<ComponentUXTheme> uxtheme = MPT_GET_COMPONENT(ComponentUXTheme); + MPT_SHARED_PTR<ComponentUXTheme> uxtheme = GetComponent<ComponentUXTheme>(); if(IsComponentAvailable(uxtheme)) { EnableThemeDialogTexture(*pWnd, ETDT_ENABLETAB); Modified: trunk/OpenMPT/soundlib/Load_mo3.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mo3.cpp 2014-12-24 09:35:42 UTC (rev 4675) +++ trunk/OpenMPT/soundlib/Load_mo3.cpp 2014-12-24 12:10:21 UTC (rev 4676) @@ -20,6 +20,7 @@ class ComponentUnMO3 : public ComponentBase { + MPT_DECLARE_COMPONENT_MEMBERS public: // Library loaded successfully. #if MPT_OS_WINDOWS @@ -95,7 +96,7 @@ #else // !NO_MO3 // Try to load unmo3 dynamically. - MPT_SHARED_PTR<ComponentUnMO3> unmo3 = MPT_GET_COMPONENT(ComponentUnMO3); + MPT_SHARED_PTR<ComponentUnMO3> unmo3 = GetComponent<ComponentUnMO3>(); if(!IsComponentAvailable(unmo3)) { // Didn't succeed. Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2014-12-24 09:35:42 UTC (rev 4675) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2014-12-24 12:10:21 UTC (rev 4676) @@ -2319,6 +2319,7 @@ class ComponentMPG123 : public ComponentBase { + MPT_DECLARE_COMPONENT_MEMBERS public: typedef struct {int foo;} mpg123_handle; int (*mpg123_init )(void); @@ -2435,7 +2436,7 @@ } } - MPT_SHARED_PTR<ComponentMPG123> mpg123 = MPT_GET_COMPONENT(ComponentMPG123); + MPT_SHARED_PTR<ComponentMPG123> mpg123 = GetComponent<ComponentMPG123>(); if(!IsComponentAvailable(mpg123)) { return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-12-24 12:42:35
|
Revision: 4677 http://sourceforge.net/p/modplug/code/4677 Author: manxorist Date: 2014-12-24 12:42:16 +0000 (Wed, 24 Dec 2014) Log Message: ----------- [Ref] Add a ComponentHandle<ComponentType> wrapper around MPT_SHARED_PTR<ComponentType> which automaticlly does GetComponent<ComponentType>() on default initialization. Modified Paths: -------------- trunk/OpenMPT/common/ComponentManager.h trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp trunk/OpenMPT/mptrack/StreamEncoderMP3.h trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp trunk/OpenMPT/mptrack/StreamEncoderOpus.h trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp trunk/OpenMPT/mptrack/StreamEncoderVorbis.h trunk/OpenMPT/mptrack/View_gen.cpp trunk/OpenMPT/soundlib/Load_mo3.cpp trunk/OpenMPT/soundlib/SampleFormats.cpp Modified: trunk/OpenMPT/common/ComponentManager.h =================================================================== --- trunk/OpenMPT/common/ComponentManager.h 2014-12-24 12:10:21 UTC (rev 4676) +++ trunk/OpenMPT/common/ComponentManager.h 2014-12-24 12:42:16 UTC (rev 4677) @@ -324,10 +324,46 @@ #endif // MPT_COMPONENT_MANAGER +// Simple wrapper around MPT_SHARED_PTR<ComponentType> which automatically +// gets a reference to the component (or constructs it) on initialization. template <typename T> -bool IsComponentAvailable(MPT_SHARED_PTR<T> component) +class ComponentHandle { - return component && component->IsAvailable(); +private: + MPT_SHARED_PTR<T> component; +public: + ComponentHandle() + : component(GetComponent<T>()) + { + return; + } + ~ComponentHandle() + { + return; + } + bool IsAvailable() const + { + return component && component->IsAvailable(); + } + T *get() const + { + return component.get(); + } + T &operator*() const + { + return *component; + } + T *operator->() const + { + return &*component; + } +}; + + +template <typename T> +bool IsComponentAvailable(const ComponentHandle<T> &handle) +{ + return handle.IsAvailable(); } Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-12-24 12:10:21 UTC (rev 4676) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-12-24 12:42:16 UTC (rev 4677) @@ -1833,7 +1833,7 @@ if(pitch > 2.0f) return 2 + (2<<8); // Check whether the DLL file exists. - MPT_SHARED_PTR<ComponentSoundTouch> soundTouch = GetComponent<ComponentSoundTouch>(); + ComponentHandle<ComponentSoundTouch> soundTouch; if(!IsComponentAvailable(soundTouch)) { MsgBox(IDS_SOUNDTOUCH_LOADFAILURE); Modified: trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp 2014-12-24 12:10:21 UTC (rev 4676) +++ trunk/OpenMPT/mptrack/StreamEncoderMP3.cpp 2014-12-24 12:42:16 UTC (rev 4677) @@ -1436,7 +1436,6 @@ #ifdef MPT_MP3ENCODER_LAME if(type == MP3EncoderDefault || type == MP3EncoderLame) { - m_Lame = GetComponent<ComponentLame>(); if(IsComponentAvailable(m_Lame)) { m_Type = MP3EncoderLame; @@ -1448,7 +1447,6 @@ #ifdef MPT_MP3ENCODER_BLADE if(type == MP3EncoderDefault || type == MP3EncoderBlade) { - m_Blade = GetComponent<ComponentBlade>(); if(IsComponentAvailable(m_Blade)) { m_Type = MP3EncoderBlade; @@ -1460,7 +1458,6 @@ #ifdef MPT_MP3ENCODER_ACM if(type == MP3EncoderDefault || type == MP3EncoderACM) { - m_Acm = GetComponent<ComponentAcmMP3>(); if(IsComponentAvailable(m_Acm)) { m_Type = MP3EncoderACM; Modified: trunk/OpenMPT/mptrack/StreamEncoderMP3.h =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderMP3.h 2014-12-24 12:10:21 UTC (rev 4676) +++ trunk/OpenMPT/mptrack/StreamEncoderMP3.h 2014-12-24 12:42:16 UTC (rev 4677) @@ -12,7 +12,9 @@ #include "StreamEncoder.h" +#include "../common/ComponentManager.h" + OPENMPT_NAMESPACE_BEGIN @@ -45,13 +47,13 @@ private: #ifdef MPT_MP3ENCODER_LAME - MPT_SHARED_PTR<ComponentLame> m_Lame; + ComponentHandle<ComponentLame> m_Lame; #endif #ifdef MPT_MP3ENCODER_BLADE - MPT_SHARED_PTR<ComponentBlade> m_Blade; + ComponentHandle<ComponentBlade> m_Blade; #endif #ifdef MPT_MP3ENCODER_ACM - MPT_SHARED_PTR<ComponentAcmMP3> m_Acm; + ComponentHandle<ComponentAcmMP3> m_Acm; #endif MP3EncoderType m_Type; Modified: trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp 2014-12-24 12:10:21 UTC (rev 4676) +++ trunk/OpenMPT/mptrack/StreamEncoderOpus.cpp 2014-12-24 12:42:16 UTC (rev 4677) @@ -568,7 +568,6 @@ OggOpusEncoder::OggOpusEncoder() //------------------------------ { - m_Opus = GetComponent<ComponentOpus>(); if(IsComponentAvailable(m_Opus)) { SetTraits(m_Opus->BuildTraits()); Modified: trunk/OpenMPT/mptrack/StreamEncoderOpus.h =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderOpus.h 2014-12-24 12:10:21 UTC (rev 4676) +++ trunk/OpenMPT/mptrack/StreamEncoderOpus.h 2014-12-24 12:42:16 UTC (rev 4677) @@ -12,7 +12,9 @@ #include "StreamEncoder.h" +#include "../common/ComponentManager.h" + OPENMPT_NAMESPACE_BEGIN @@ -23,7 +25,7 @@ private: - MPT_SHARED_PTR<ComponentOpus> m_Opus; + ComponentHandle<ComponentOpus> m_Opus; public: Modified: trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp 2014-12-24 12:10:21 UTC (rev 4676) +++ trunk/OpenMPT/mptrack/StreamEncoderVorbis.cpp 2014-12-24 12:42:16 UTC (rev 4677) @@ -399,7 +399,6 @@ VorbisEncoder::VorbisEncoder() //---------------------------- { - m_Vorbis = GetComponent<ComponentVorbis>(); if(IsComponentAvailable(m_Vorbis)) { SetTraits(m_Vorbis->BuildTraits()); Modified: trunk/OpenMPT/mptrack/StreamEncoderVorbis.h =================================================================== --- trunk/OpenMPT/mptrack/StreamEncoderVorbis.h 2014-12-24 12:10:21 UTC (rev 4676) +++ trunk/OpenMPT/mptrack/StreamEncoderVorbis.h 2014-12-24 12:42:16 UTC (rev 4677) @@ -12,7 +12,9 @@ #include "StreamEncoder.h" +#include "../common/ComponentManager.h" + OPENMPT_NAMESPACE_BEGIN @@ -23,7 +25,7 @@ private: - MPT_SHARED_PTR<ComponentVorbis> m_Vorbis; + ComponentHandle<ComponentVorbis> m_Vorbis; public: Modified: trunk/OpenMPT/mptrack/View_gen.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_gen.cpp 2014-12-24 12:10:21 UTC (rev 4676) +++ trunk/OpenMPT/mptrack/View_gen.cpp 2014-12-24 12:42:16 UTC (rev 4677) @@ -1579,7 +1579,7 @@ { case CTLCOLOR_DLG: { - MPT_SHARED_PTR<ComponentUXTheme> uxtheme = GetComponent<ComponentUXTheme>(); + ComponentHandle<ComponentUXTheme> uxtheme; if(IsComponentAvailable(uxtheme)) { EnableThemeDialogTexture(*pWnd, ETDT_ENABLETAB); Modified: trunk/OpenMPT/soundlib/Load_mo3.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mo3.cpp 2014-12-24 12:10:21 UTC (rev 4676) +++ trunk/OpenMPT/soundlib/Load_mo3.cpp 2014-12-24 12:42:16 UTC (rev 4677) @@ -96,7 +96,7 @@ #else // !NO_MO3 // Try to load unmo3 dynamically. - MPT_SHARED_PTR<ComponentUnMO3> unmo3 = GetComponent<ComponentUnMO3>(); + ComponentHandle<ComponentUnMO3> unmo3; if(!IsComponentAvailable(unmo3)) { // Didn't succeed. Modified: trunk/OpenMPT/soundlib/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2014-12-24 12:10:21 UTC (rev 4676) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2014-12-24 12:42:16 UTC (rev 4677) @@ -2436,7 +2436,7 @@ } } - MPT_SHARED_PTR<ComponentMPG123> mpg123 = GetComponent<ComponentMPG123>(); + ComponentHandle<ComponentMPG123> mpg123; if(!IsComponentAvailable(mpg123)) { return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-12-24 13:32:39
|
Revision: 4678 http://sourceforge.net/p/modplug/code/4678 Author: manxorist Date: 2014-12-24 13:32:33 +0000 (Wed, 24 Dec 2014) Log Message: ----------- [Ref] sounddev: For troubleshooting and debugging purposes, allow blocking the whole PortAudio initilization/enumeration via the component framework with [Components]BlockPortAudio. Modified Paths: -------------- trunk/OpenMPT/common/ComponentManager.h trunk/OpenMPT/sounddev/SoundDevice.cpp trunk/OpenMPT/sounddev/SoundDevice.h trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp trunk/OpenMPT/sounddev/SoundDevicePortAudio.h Modified: trunk/OpenMPT/common/ComponentManager.h =================================================================== --- trunk/OpenMPT/common/ComponentManager.h 2014-12-24 12:42:16 UTC (rev 4677) +++ trunk/OpenMPT/common/ComponentManager.h 2014-12-24 13:32:33 UTC (rev 4678) @@ -30,6 +30,7 @@ enum ComponentType { + ComponentTypeBuiltin, // PortAudio ComponentTypeSystem, // uxtheme.dll, mf.dll ComponentTypeSystemInstallable, // acm mp3 codec ComponentTypeBundled, // libsoundtouch @@ -142,6 +143,21 @@ #define MPT_COMPONENT_BIND_SYMBOL_OPTIONAL(libName, symbol, func) Bind( func , libName , symbol ) +class ComponentBuiltin : public ComponentBase +{ +public: + ComponentBuiltin() + : ComponentBase(ComponentTypeBuiltin) + { + return; + } + virtual bool DoInitialize() + { + return true; + } +}; + + class ComponentSystemDLL : public ComponentBase { private: Modified: trunk/OpenMPT/sounddev/SoundDevice.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.cpp 2014-12-24 12:42:16 UTC (rev 4677) +++ trunk/OpenMPT/sounddev/SoundDevice.cpp 2014-12-24 13:32:33 UTC (rev 4678) @@ -458,8 +458,10 @@ m_DeviceDynamicCaps.clear(); #ifndef NO_PORTAUDIO - SndDevPortaudioUnnitialize(); - SndDevPortaudioInitialize(); + if(IsComponentAvailable(m_PortAudio)) + { + m_PortAudio->ReInit(); + } #endif // NO_PORTAUDIO { @@ -473,10 +475,12 @@ } #endif // NO_ASIO #ifndef NO_PORTAUDIO + if(IsComponentAvailable(m_PortAudio)) { const std::vector<SoundDevice::Info> infos = CPortaudioDevice::EnumerateDevices(TypePORTAUDIO_WASAPI); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); } + if(IsComponentAvailable(m_PortAudio)) { const std::vector<SoundDevice::Info> infos = CPortaudioDevice::EnumerateDevices(TypePORTAUDIO_WDMKS); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); @@ -493,14 +497,17 @@ // duplicate devices, only used if [Sound Settings]MorePortaudio=1 #ifndef NO_PORTAUDIO + if(IsComponentAvailable(m_PortAudio)) { const std::vector<SoundDevice::Info> infos = CPortaudioDevice::EnumerateDevices(TypePORTAUDIO_WMME); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); } + if(IsComponentAvailable(m_PortAudio)) { const std::vector<SoundDevice::Info> infos = CPortaudioDevice::EnumerateDevices(TypePORTAUDIO_ASIO); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); } + if(IsComponentAvailable(m_PortAudio)) { const std::vector<SoundDevice::Info> infos = CPortaudioDevice::EnumerateDevices(TypePORTAUDIO_DS); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); @@ -728,7 +735,10 @@ case TypePORTAUDIO_WMME: case TypePORTAUDIO_DS: case TypePORTAUDIO_ASIO: - result = SndDevPortaudioIsInitialized() ? new CPortaudioDevice(info) : nullptr; + if(IsComponentAvailable(m_PortAudio)) + { + result = new CPortaudioDevice(info); + } break; #endif // NO_PORTAUDIO } @@ -757,9 +767,7 @@ Manager::~Manager() //----------------- { -#ifndef NO_PORTAUDIO - SndDevPortaudioUnnitialize(); -#endif // NO_PORTAUDIO + return; } Modified: trunk/OpenMPT/sounddev/SoundDevice.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.h 2014-12-24 12:42:16 UTC (rev 4677) +++ trunk/OpenMPT/sounddev/SoundDevice.h 2014-12-24 13:32:33 UTC (rev 4678) @@ -14,6 +14,7 @@ #include "../common/mutex.h" #include "../common/misc_util.h" #include "../common/mptAtomic.h" +#include "../common/ComponentManager.h" #include "../soundlib/SampleFormat.h" #include <map> @@ -636,11 +637,19 @@ }; +class ComponentPortAudio; + + //=========== class Manager //=========== { private: + +#ifndef NO_PORTAUDIO + ComponentHandle<ComponentPortAudio> m_PortAudio; +#endif // NO_PORTAUDIO + std::vector<SoundDevice::Info> m_SoundDevices; std::map<SoundDevice::Identifier, bool> m_DeviceUnavailable; std::map<SoundDevice::Identifier, SoundDevice::Caps> m_DeviceCaps; Modified: trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp 2014-12-24 12:42:16 UTC (rev 4677) +++ trunk/OpenMPT/sounddev/SoundDevicePortAudio.cpp 2014-12-24 13:32:33 UTC (rev 4678) @@ -462,10 +462,6 @@ //----------------------------------------------------------------------------------- { std::vector<SoundDevice::Info> devices; - if(!SndDevPortaudioIsInitialized()) - { - return devices; - } for(SoundDevice::Index index = 0; ; ++index) { SoundDevice::Info info; @@ -479,9 +475,6 @@ } -static bool g_PortaudioInitialized = false; - - static void PortaudioLog(const char *text) //---------------------------------------- { @@ -492,28 +485,39 @@ } -void SndDevPortaudioInitialize() -//------------------------------ +MPT_REGISTERED_COMPONENT(ComponentPortAudio) + + +ComponentPortAudio::ComponentPortAudio() { + return; +} + + +bool ComponentPortAudio::DoInitialize() +{ PaUtil_SetDebugPrintFunction(PortaudioLog); - if(Pa_Initialize() != paNoError) return; - g_PortaudioInitialized = true; + return (Pa_Initialize() == paNoError); } -void SndDevPortaudioUnnitialize() -//------------------------------- +ComponentPortAudio::~ComponentPortAudio() { - if(!g_PortaudioInitialized) return; - Pa_Terminate(); - g_PortaudioInitialized = false; + if(IsAvailable()) + { + Pa_Terminate(); + } } -bool SndDevPortaudioIsInitialized() -//--------------------------------- +bool ComponentPortAudio::ReInit() { - return g_PortaudioInitialized; + if(!IsAvailable()) + { + return false; + } + Pa_Terminate(); + return DoInitialize(); } Modified: trunk/OpenMPT/sounddev/SoundDevicePortAudio.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevicePortAudio.h 2014-12-24 12:42:16 UTC (rev 4677) +++ trunk/OpenMPT/sounddev/SoundDevicePortAudio.h 2014-12-24 13:32:33 UTC (rev 4678) @@ -12,6 +12,8 @@ #include "SoundDevice.h" +#include "../common/ComponentManager.h" + #ifndef NO_PORTAUDIO #include "portaudio/include/portaudio.h" #include "portaudio/include/pa_win_wasapi.h" @@ -90,11 +92,19 @@ }; -void SndDevPortaudioInitialize(); -void SndDevPortaudioUnnitialize(); -bool SndDevPortaudioIsInitialized(); +class ComponentPortAudio : public ComponentBuiltin +{ + MPT_DECLARE_COMPONENT_MEMBERS +public: + ComponentPortAudio(); + virtual ~ComponentPortAudio(); + std::string GetSettingsKey() const { return "PortAudio"; } + virtual bool DoInitialize(); + bool ReInit(); +}; + #endif // NO_PORTAUDIO This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-12-29 23:18:35
|
Revision: 4683 http://sourceforge.net/p/modplug/code/4683 Author: saga-games Date: 2014-12-29 23:18:18 +0000 (Mon, 29 Dec 2014) Log Message: ----------- [New] Pattern tab: Added suppport for custom pattern fonts as well as upscaled variants of the built-in fonts. [Mod] OpenMPT: Version is now 1.24.01.02 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moptions.cpp trunk/OpenMPT/mptrack/Moptions.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/Mptrack.h trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/WelcomeDialog.cpp trunk/OpenMPT/mptrack/mptrack.rc trunk/OpenMPT/mptrack/mptrack_08.vcproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj trunk/OpenMPT/mptrack/mptrack_10.vcxproj.filters Added Paths: ----------- trunk/OpenMPT/mptrack/PatternFont.cpp trunk/OpenMPT/mptrack/PatternFont.h Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-12-29 19:06:33 UTC (rev 4682) +++ trunk/OpenMPT/common/versionNumber.h 2014-12-29 23:18:18 UTC (rev 4683) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 24 #define VER_MINOR 01 -#define VER_MINORMINOR 01 +#define VER_MINORMINOR 02 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-12-29 19:06:33 UTC (rev 4682) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-12-29 23:18:18 UTC (rev 4683) @@ -21,6 +21,7 @@ #include "../soundlib/tuningbase.h" #include "../common/StringFixer.h" #include "EffectInfo.h" +#include "PatternFont.h" #include <string> @@ -30,7 +31,6 @@ // Headers #define ROWHDR_WIDTH 32 // Row header #define COLHDR_HEIGHT 16 // Column header -#define COLUMN_HEIGHT 13 #define VUMETERS_HEIGHT 13 // Height of vu-meters #define PLUGNAME_HEIGHT 16 // Height of plugin names #define VUMETERS_BMPWIDTH 32 @@ -55,80 +55,9 @@ }; -struct PATTERNFONT -{ - int nWidth, nHeight; // Column Width & Height, including 4-pixels border - int nClrX, nClrY; // Clear (empty note) location - int nSpaceX, nSpaceY; // White location (must be big enough) - UINT nEltWidths[5]; // Elements Sizes - int nNumX, nNumY; // Vertically-oriented numbers 0x00-0x0F - int nNum10X, nNum10Y; // Numbers 10-19 - int nAlphaAM_X,nAlphaAM_Y; // Letters A-M +# - int nAlphaNZ_X,nAlphaNZ_Y; // Letters N-Z +? - int nNoteX, nNoteY; // Notes ..., C-, C#, ... - int nNoteWidth; // Total width of note (C#) - int nOctaveWidth; // Octave Width - int nVolX, nVolY; // Volume Column Effects - int nVolCmdWidth; // Width of volume effect - int nVolHiWidth; // Width of first character in volume parameter - int nCmdOfs; // XOffset (-xxx) around the command letter - int nParamHiWidth; - int nInstrOfs, nInstr10Ofs, nInstrHiWidth; -}; -typedef const PATTERNFONT * PCPATTERNFONT; -////////////////////////////////////////////// -// Font Definitions -// Medium Font (Default) -const PATTERNFONT gDefaultPatternFont = -{ - 92,13, // Column Width & Height - 0,0, // Clear location - 130,8, // Space Location. - {20, 20, 24, 9, 15}, // Element Widths - 20,13, // Numbers 0-F (hex) - 30,13, // Numbers 10-19 (dec) - 64,26, // A-M# - 78,26, // N-Z? // MEDIUM FONT !!! - 0, 0, - 12,8, // Note & Octave Width - 42,13, // Volume Column Effects - 8,8, - -1, - 8, // 8+7 = 15 - -3, -1, 12, -}; - - -////////////////////////////////////////////////// -// Small Font - -const PATTERNFONT gSmallPatternFont = -{ - 70,11, // Column Width & Height - 92,0, // Clear location - 130,8, // Space Location. - {16, 14, 18, 7, 11}, // Element Widths - 108,13, // Numbers 0-F (hex) - 120,13, // Numbers 10-19 (dec) - 142,26, // A-M# - 150,26, // N-Z? // SMALL FONT !!! - 92, 0, // Notes - 10,6, // Note & Octave Width - 132,13, // Volume Column Effects - 6,5, - -1, - 6, // 8+7 = 15 - -3, 1, 9, // InstrOfs + nInstrHiWidth -}; - -// NOTE: See also CViewPattern::DrawNote() when changing stuff here -// or adding new fonts - The custom tuning note names might require -// some additions there. - - ///////////////////////////////////////////////////////////////////////////// // Effect colour codes @@ -144,17 +73,9 @@ STATIC_ASSERT(CountOf(effectColors) == MAX_EFFECT_TYPE); - ///////////////////////////////////////////////////////////////////////////// // CViewPattern Drawing Implementation -inline PCPATTERNFONT GetCurrentPatternFont() -//------------------------------------------ -{ - return (TrackerSettings::Instance().m_dwPatternSetup & PATTERN_SMALLFONT) ? &gSmallPatternFont : &gDefaultPatternFont; -} - - static BYTE hilightcolor(int c0, int c1) //-------------------------------------- { @@ -198,8 +119,8 @@ bool CViewPattern::UpdateSizes() //------------------------------ { - PCPATTERNFONT pfnt = GetCurrentPatternFont(); - int oldx = m_szCell.cx; + const PATTERNFONT *pfnt = PatternFont::currentFont; + int oldx = m_szCell.cx, oldy = m_szCell.cy; m_szHeader.cx = ROWHDR_WIDTH; m_szHeader.cy = COLHDR_HEIGHT; if(m_Status[psShowVUMeters]) m_szHeader.cy += VUMETERS_HEIGHT; @@ -209,14 +130,20 @@ if (m_nDetailLevel >= PatternCursor::volumeColumn) m_szCell.cx += pfnt->nEltWidths[2]; if (m_nDetailLevel >= PatternCursor::effectColumn) m_szCell.cx += pfnt->nEltWidths[3] + pfnt->nEltWidths[4]; m_szCell.cy = pfnt->nHeight; - return (oldx != m_szCell.cx); + + if(oldy != m_szCell.cy) + { + m_Dib.SetSize(m_Dib.GetWidth(), m_szCell.cy); + } + + return (oldx != m_szCell.cx || oldy != m_szCell.cy); } UINT CViewPattern::GetColumnOffset(PatternCursor::Columns column) const //--------------------------------------------------------------------- { - PCPATTERNFONT pfnt = GetCurrentPatternFont(); + const PATTERNFONT *pfnt = PatternFont::currentFont; LimitMax(column, PatternCursor::lastColumn); UINT offset = 0; for(int i = PatternCursor::firstColumn; i < column; i++) offset += pfnt->nEltWidths[i]; @@ -233,6 +160,7 @@ } if(hint.GetType()[HINT_MPTOPTIONS]) { + PatternFont::UpdateFont(GetDC()); UpdateColors(); UpdateSizes(); UpdateScrollSize(); @@ -268,7 +196,7 @@ POINT CViewPattern::GetPointFromPosition(PatternCursor cursor) //------------------------------------------------------------ { - PCPATTERNFONT pfnt = GetCurrentPatternFont(); + const PATTERNFONT *pfnt = PatternFont::currentFont; POINT pt; int xofs = GetXScrollPos(); int yofs = GetYScrollPos(); @@ -303,7 +231,7 @@ PatternCursor CViewPattern::GetPositionFromPoint(POINT pt) //-------------------------------------------------------- { - PCPATTERNFONT pfnt = GetCurrentPatternFont(); + const PATTERNFONT *pfnt = PatternFont::currentFont; int xofs = GetXScrollPos(); int yofs = GetYScrollPos(); int x = xofs + (pt.x - m_szHeader.cx) / GetColumnWidth(); @@ -326,43 +254,43 @@ void CViewPattern::DrawLetter(int x, int y, char letter, int sizex, int ofsx) //--------------------------------------------------------------------------- { - PCPATTERNFONT pfnt = GetCurrentPatternFont(); + const PATTERNFONT *pfnt = PatternFont::currentFont; int srcx = pfnt->nSpaceX, srcy = pfnt->nSpaceY; if ((letter >= '0') && (letter <= '9')) { srcx = pfnt->nNumX; - srcy = pfnt->nNumY + (letter - '0') * COLUMN_HEIGHT; + srcy = pfnt->nNumY + (letter - '0') * pfnt->spacingY; } else if ((letter >= 'A') && (letter < 'N')) { srcx = pfnt->nAlphaAM_X; - srcy = pfnt->nAlphaAM_Y + (letter - 'A') * COLUMN_HEIGHT; + srcy = pfnt->nAlphaAM_Y + (letter - 'A') * pfnt->spacingY; } else if ((letter >= 'N') && (letter <= 'Z')) { srcx = pfnt->nAlphaNZ_X; - srcy = pfnt->nAlphaNZ_Y + (letter - 'N') * COLUMN_HEIGHT; + srcy = pfnt->nAlphaNZ_Y + (letter - 'N') * pfnt->spacingY; } else switch(letter) { case '?': srcx = pfnt->nAlphaNZ_X; - srcy = pfnt->nAlphaNZ_Y + 13 * COLUMN_HEIGHT; + srcy = pfnt->nAlphaNZ_Y + 13 * pfnt->spacingY; break; case '#': srcx = pfnt->nAlphaAM_X; - srcy = pfnt->nAlphaAM_Y + 13 * COLUMN_HEIGHT; + srcy = pfnt->nAlphaAM_Y + 13 * pfnt->spacingY; break; //rewbs.smoothVST case '\\': srcx = pfnt->nAlphaNZ_X; - srcy = pfnt->nAlphaNZ_Y + 14 * COLUMN_HEIGHT; + srcy = pfnt->nAlphaNZ_Y + 14 * pfnt->spacingY; break; //end rewbs.smoothVST case ':': srcx = pfnt->nAlphaNZ_X; - srcy = pfnt->nAlphaNZ_Y + 15 * COLUMN_HEIGHT; + srcy = pfnt->nAlphaNZ_Y + 15 * pfnt->spacingY; break; case ' ': srcx = pfnt->nSpaceX; @@ -370,47 +298,53 @@ break; case '-': srcx = pfnt->nAlphaAM_X; - srcy = pfnt->nAlphaAM_Y + 15 * COLUMN_HEIGHT; + srcy = pfnt->nAlphaAM_Y + 15 * pfnt->spacingY; break; case 'b': srcx = pfnt->nAlphaAM_X; - srcy = pfnt->nAlphaAM_Y + 14 * COLUMN_HEIGHT; + srcy = pfnt->nAlphaAM_Y + 14 * pfnt->spacingY; break; } - m_Dib.TextBlt(x, y, sizex, COLUMN_HEIGHT, srcx+ofsx, srcy); + m_Dib.TextBlt(x, y, sizex, pfnt->spacingY, srcx+ofsx, srcy, pfnt->dib); } +forceinline static void DrawPadding(CFastBitmap &dib, const PATTERNFONT *pfnt, int x, int y, int col) +{ + if(pfnt->padding[col]) + dib.TextBlt(x + pfnt->nEltWidths[col] - pfnt->padding[col], y, pfnt->padding[col], pfnt->spacingY, pfnt->nClrX + pfnt->nEltWidths[col] - pfnt->padding[col], pfnt->nClrY, pfnt->dib); +} + void CViewPattern::DrawNote(int x, int y, UINT note, CTuning* pTuning) //-------------------------------------------------------------------- { - PCPATTERNFONT pfnt = GetCurrentPatternFont(); + const PATTERNFONT *pfnt = PatternFont::currentFont; UINT xsrc = pfnt->nNoteX, ysrc = pfnt->nNoteY, dx = pfnt->nEltWidths[0]; if (!note) { - m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc); + m_Dib.TextBlt(x, y, dx, pfnt->spacingY, xsrc, ysrc, pfnt->dib); } else if (note == NOTE_NOTECUT) { - m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 13*COLUMN_HEIGHT); + m_Dib.TextBlt(x, y, dx, pfnt->spacingY, xsrc, ysrc + 13*pfnt->spacingY, pfnt->dib); } else if (note == NOTE_KEYOFF) { - m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 14*COLUMN_HEIGHT); + m_Dib.TextBlt(x, y, dx, pfnt->spacingY, xsrc, ysrc + 14*pfnt->spacingY, pfnt->dib); } else if(note == NOTE_FADE) { - m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 17*COLUMN_HEIGHT); + m_Dib.TextBlt(x, y, dx, pfnt->spacingY, xsrc, ysrc + 17*pfnt->spacingY, pfnt->dib); } else if(note == NOTE_PC) { - m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 15*COLUMN_HEIGHT); + m_Dib.TextBlt(x, y, dx, pfnt->spacingY, xsrc, ysrc + 15*pfnt->spacingY, pfnt->dib); } else if(note == NOTE_PCS) { - m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, xsrc, ysrc + 16*COLUMN_HEIGHT); + m_Dib.TextBlt(x, y, dx, pfnt->spacingY, xsrc, ysrc + 16*pfnt->spacingY, pfnt->dib); } else { if(pTuning) @@ -419,72 +353,65 @@ if(noteStr.size() < 3) noteStr.resize(3, ' '); - // Hack: Manual tweaking for default/small font displays. - if(pfnt == &gDefaultPatternFont) - { - DrawLetter(x, y, noteStr[0], 7, 0); - DrawLetter(x + 7, y, noteStr[1], 6, 0); - } - else - { - DrawLetter(x, y, noteStr[0], 5, 0); - DrawLetter(x + 5, y, noteStr[1], 5, 0); - } + DrawLetter(x, y, noteStr[0], pfnt->nNoteWidth / 2, 0); + DrawLetter(x + pfnt->nNoteWidth / 2, y, noteStr[1], pfnt->nNoteWidth / 2, 0); DrawLetter(x + pfnt->nNoteWidth, y, noteStr[2], pfnt->nOctaveWidth, 0); } else //Original { UINT o = (note-1) / 12; //Octave UINT n = (note-1) % 12; //Note - m_Dib.TextBlt(x, y, pfnt->nNoteWidth, COLUMN_HEIGHT, xsrc, ysrc+(n+1)*COLUMN_HEIGHT); + m_Dib.TextBlt(x, y, pfnt->nNoteWidth, pfnt->spacingY, xsrc, ysrc+(n+1)*pfnt->spacingY, pfnt->dib); if(o <= 9) - m_Dib.TextBlt(x+pfnt->nNoteWidth, y, pfnt->nOctaveWidth, COLUMN_HEIGHT, - pfnt->nNumX, pfnt->nNumY+o*COLUMN_HEIGHT); + m_Dib.TextBlt(x+pfnt->nNoteWidth, y, pfnt->nOctaveWidth, pfnt->spacingY, + pfnt->nNumX, pfnt->nNumY+o*pfnt->spacingY, pfnt->dib); else DrawLetter(x+pfnt->nNoteWidth, y, '?', pfnt->nOctaveWidth); } } + DrawPadding(m_Dib, pfnt, x, y, 0); } void CViewPattern::DrawInstrument(int x, int y, UINT instr) //--------------------------------------------------------- { - PCPATTERNFONT pfnt = GetCurrentPatternFont(); + const PATTERNFONT *pfnt = PatternFont::currentFont; if (instr) { UINT dx = pfnt->nInstrHiWidth; if (instr < 100) { - m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, pfnt->nNumX+pfnt->nInstrOfs, pfnt->nNumY+(instr / 10)*COLUMN_HEIGHT); + m_Dib.TextBlt(x, y, dx, pfnt->spacingY, pfnt->nNumX+pfnt->nInstrOfs, pfnt->nNumY+(instr / 10)*pfnt->spacingY, pfnt->dib); } else { - m_Dib.TextBlt(x, y, dx, COLUMN_HEIGHT, pfnt->nNum10X+pfnt->nInstr10Ofs, pfnt->nNum10Y+((instr-100) / 10)*COLUMN_HEIGHT); + m_Dib.TextBlt(x, y, dx, pfnt->spacingY, pfnt->nNum10X+pfnt->nInstr10Ofs, pfnt->nNum10Y+((instr-100) / 10)*pfnt->spacingY, pfnt->dib); } - m_Dib.TextBlt(x+dx, y, pfnt->nEltWidths[1]-dx, COLUMN_HEIGHT, pfnt->nNumX+1, pfnt->nNumY+(instr % 10)*COLUMN_HEIGHT); + m_Dib.TextBlt(x+dx, y, pfnt->nEltWidths[1]-dx, pfnt->spacingY, pfnt->nNumX+pfnt->paramLoMargin, pfnt->nNumY+(instr % 10)*pfnt->spacingY, pfnt->dib); } else { - m_Dib.TextBlt(x, y, pfnt->nEltWidths[1], COLUMN_HEIGHT, pfnt->nClrX+pfnt->nEltWidths[0], pfnt->nClrY); + m_Dib.TextBlt(x, y, pfnt->nEltWidths[1], pfnt->spacingY, pfnt->nClrX+pfnt->nEltWidths[0], pfnt->nClrY, pfnt->dib); } + DrawPadding(m_Dib, pfnt, x, y, 1); } void CViewPattern::DrawVolumeCommand(int x, int y, const ModCommand &mc, bool drawDefaultVolume) //---------------------------------------------------------------------------------------------- { - PCPATTERNFONT pfnt = GetCurrentPatternFont(); + const PATTERNFONT *pfnt = PatternFont::currentFont; if(mc.IsPcNote()) { //If note is parameter control note, drawing volume command differently. const int val = MIN(ModCommand::maxColumnValue, mc.GetValueVolCol()); - m_Dib.TextBlt(x, y, 1, COLUMN_HEIGHT, pfnt->nClrX, pfnt->nClrY); - m_Dib.TextBlt(x + 1, y, pfnt->nVolCmdWidth, COLUMN_HEIGHT, - pfnt->nNumX, pfnt->nNumY+(val / 100)*COLUMN_HEIGHT); - m_Dib.TextBlt(x+pfnt->nVolCmdWidth, y, pfnt->nVolHiWidth, COLUMN_HEIGHT, - pfnt->nNumX, pfnt->nNumY+((val / 10)%10)*COLUMN_HEIGHT); - m_Dib.TextBlt(x+pfnt->nVolCmdWidth+pfnt->nVolHiWidth, y, pfnt->nEltWidths[2]-(pfnt->nVolCmdWidth+pfnt->nVolHiWidth), COLUMN_HEIGHT, - pfnt->nNumX, pfnt->nNumY+(val % 10)*COLUMN_HEIGHT); + if(pfnt->pcParamMargin) m_Dib.TextBlt(x, y, pfnt->pcParamMargin, pfnt->spacingY, pfnt->nClrX, pfnt->nClrY, pfnt->dib); + m_Dib.TextBlt(x + pfnt->pcParamMargin, y, pfnt->nVolCmdWidth, pfnt->spacingY, + pfnt->nNumX, pfnt->nNumY+(val / 100)*pfnt->spacingY, pfnt->dib); + m_Dib.TextBlt(x+pfnt->nVolCmdWidth, y, pfnt->nVolHiWidth, pfnt->spacingY, + pfnt->nNumX, pfnt->nNumY+((val / 10)%10)*pfnt->spacingY, pfnt->dib); + m_Dib.TextBlt(x+pfnt->nVolCmdWidth+pfnt->nVolHiWidth, y, pfnt->nEltWidths[2]-(pfnt->nVolCmdWidth+pfnt->nVolHiWidth), pfnt->spacingY, + pfnt->nNumX, pfnt->nNumY+(val % 10)*pfnt->spacingY, pfnt->dib); } else { ModCommand::VOLCMD volcmd = std::min<ModCommand::VOLCMD>(mc.volcmd, MAX_VOLCMDS - 1); @@ -517,18 +444,19 @@ if(volcmd != VOLCMD_NONE) { - m_Dib.TextBlt(x, y, pfnt->nVolCmdWidth, COLUMN_HEIGHT, - pfnt->nVolX, pfnt->nVolY + volcmd * COLUMN_HEIGHT); - m_Dib.TextBlt(x+pfnt->nVolCmdWidth, y, pfnt->nVolHiWidth, COLUMN_HEIGHT, - pfnt->nNumX, pfnt->nNumY + (vol / 10) * COLUMN_HEIGHT); - m_Dib.TextBlt(x+pfnt->nVolCmdWidth + pfnt->nVolHiWidth, y, pfnt->nEltWidths[2] - (pfnt->nVolCmdWidth + pfnt->nVolHiWidth), COLUMN_HEIGHT, - pfnt->nNumX, pfnt->nNumY + (vol % 10) * COLUMN_HEIGHT); + m_Dib.TextBlt(x, y, pfnt->nVolCmdWidth, pfnt->spacingY, + pfnt->nVolX, pfnt->nVolY + volcmd * pfnt->spacingY, pfnt->dib); + m_Dib.TextBlt(x+pfnt->nVolCmdWidth, y, pfnt->nVolHiWidth, pfnt->spacingY, + pfnt->nNumX, pfnt->nNumY + (vol / 10) * pfnt->spacingY, pfnt->dib); + m_Dib.TextBlt(x+pfnt->nVolCmdWidth + pfnt->nVolHiWidth, y, pfnt->nEltWidths[2] - (pfnt->nVolCmdWidth + pfnt->nVolHiWidth), pfnt->spacingY, + pfnt->nNumX, pfnt->nNumY + (vol % 10) * pfnt->spacingY, pfnt->dib); } else { int srcx = pfnt->nEltWidths[0] + pfnt->nEltWidths[1]; - m_Dib.TextBlt(x, y, pfnt->nEltWidths[2], COLUMN_HEIGHT, pfnt->nClrX+srcx, pfnt->nClrY); + m_Dib.TextBlt(x, y, pfnt->nEltWidths[2], pfnt->spacingY, pfnt->nClrX+srcx, pfnt->nClrY, pfnt->dib); } } + DrawPadding(m_Dib, pfnt, x, y, 2); } @@ -784,7 +712,7 @@ return; } - PCPATTERNFONT pfnt = GetCurrentPatternFont(); + const PATTERNFONT *pfnt = PatternFont::currentFont; const ModCommand m0 = ModCommand::Empty(); const ModCommand *pPattern = sndFile.Patterns[nPattern]; CHAR s[256]; @@ -810,11 +738,11 @@ { UINT maxndx = sndFile.GetNumChannels() * m_szCell.cx; UINT ibmp = 0; - if (maxndx > FASTBMP_MAXWIDTH) maxndx = FASTBMP_MAXWIDTH; + if (maxndx > (UINT)m_Dib.GetWidth()) maxndx = m_Dib.GetWidth(); do { ibmp += nColumnWidth; - m_Dib.TextBlt(ibmp-4, 0, 4, m_szCell.cy, pfnt->nClrX+pfnt->nWidth-4, pfnt->nClrY); + m_Dib.TextBlt(ibmp-4, 0, 4, m_szCell.cy, pfnt->nClrX+pfnt->nWidth-4, pfnt->nClrY, pfnt->dib); } while (ibmp + nColumnWidth <= maxndx); } @@ -951,7 +879,7 @@ if (m->IsEmpty() && ((!col_sel) || (col_sel == COLUMN_BITS_ALLCOLUMNS))) { m_Dib.SetTextColor(tx_col, bk_col); - m_Dib.TextBlt(xbmp, 0, nColumnWidth-4, m_szCell.cy, pfnt->nClrX, pfnt->nClrY); + m_Dib.TextBlt(xbmp, 0, nColumnWidth-4, m_szCell.cy, pfnt->nClrX, pfnt->nClrY, pfnt->dib); goto DoBlit; } x = 0; @@ -1066,8 +994,8 @@ m_Dib.SetTextColor(tx_col, bk_col); if(isPCnote) { - m_Dib.TextBlt(xbmp + x, 0, 2, COLUMN_HEIGHT, pfnt->nClrX+x, pfnt->nClrY); - m_Dib.TextBlt(xbmp + x + 2, 0, pfnt->nEltWidths[3], m_szCell.cy, pfnt->nNumX, pfnt->nNumY+(val / 100)*COLUMN_HEIGHT); + m_Dib.TextBlt(xbmp + x, 0, 2, pfnt->spacingY, pfnt->nClrX+x, pfnt->nClrY, pfnt->dib); + m_Dib.TextBlt(xbmp + x + pfnt->pcValMargin, 0, pfnt->nEltWidths[3], m_szCell.cy, pfnt->nNumX, pfnt->nNumY+(val / 100)*pfnt->spacingY, pfnt->dib); } else { if(m->command != CMD_NONE) @@ -1077,9 +1005,10 @@ DrawLetter(xbmp+x, 0, n, pfnt->nEltWidths[3], pfnt->nCmdOfs); } else { - m_Dib.TextBlt(xbmp+x, 0, pfnt->nEltWidths[3], COLUMN_HEIGHT, pfnt->nClrX+x, pfnt->nClrY); + m_Dib.TextBlt(xbmp+x, 0, pfnt->nEltWidths[3], pfnt->spacingY, pfnt->nClrX+x, pfnt->nClrY, pfnt->dib); } } + DrawPadding(m_Dib, pfnt, xbmp + x, 0, 3); } x += pfnt->nEltWidths[3]; // Param @@ -1097,27 +1026,28 @@ m_Dib.SetTextColor(tx_col, bk_col); if(isPCnote) { - m_Dib.TextBlt(xbmp + x, 0, pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX, pfnt->nNumY+((val / 10) % 10)*COLUMN_HEIGHT); - m_Dib.TextBlt(xbmp + x + pfnt->nParamHiWidth, 0, pfnt->nEltWidths[4]-pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX+1, pfnt->nNumY+(val % 10)*COLUMN_HEIGHT); + m_Dib.TextBlt(xbmp + x, 0, pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX, pfnt->nNumY+((val / 10) % 10)*pfnt->spacingY, pfnt->dib); + m_Dib.TextBlt(xbmp + x + pfnt->nParamHiWidth, 0, pfnt->nEltWidths[4] - pfnt->padding[4] - pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX+pfnt->paramLoMargin, pfnt->nNumY+(val % 10)*pfnt->spacingY, pfnt->dib); } else { if (m->command) { - m_Dib.TextBlt(xbmp+x, 0, pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX, pfnt->nNumY+(m->param >> 4)*COLUMN_HEIGHT); - m_Dib.TextBlt(xbmp+x+pfnt->nParamHiWidth, 0, pfnt->nEltWidths[4]-pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX+1, pfnt->nNumY+(m->param & 0x0F)*COLUMN_HEIGHT); + m_Dib.TextBlt(xbmp + x, 0, pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX, pfnt->nNumY+(m->param >> 4)*pfnt->spacingY, pfnt->dib); + m_Dib.TextBlt(xbmp + x + pfnt->nParamHiWidth, 0, pfnt->nEltWidths[4] - pfnt->padding[4] - pfnt->nParamHiWidth, m_szCell.cy, pfnt->nNumX+pfnt->paramLoMargin, pfnt->nNumY+(m->param & 0x0F)*pfnt->spacingY, pfnt->dib); } else { - m_Dib.TextBlt(xbmp+x, 0, pfnt->nEltWidths[4], m_szCell.cy, pfnt->nClrX+x, pfnt->nClrY); + m_Dib.TextBlt(xbmp+x, 0, pfnt->nEltWidths[4], m_szCell.cy, pfnt->nClrX+x, pfnt->nClrY, pfnt->dib); } } + DrawPadding(m_Dib, pfnt, xbmp + x, 0, 4); } } DoBlit: nbmp++; xbmp += nColumnWidth; xpaint += nColumnWidth; - if ((xbmp + nColumnWidth >= FASTBMP_MAXWIDTH) || (xpaint >= rcClient.right)) break; + if ((xbmp + nColumnWidth >= (UINT)m_Dib.GetWidth()) || (xpaint >= rcClient.right)) break; } while (++col < maxcol); m_Dib.Blit(hdc, xpaint-xbmp, ypaint, xbmp, m_szCell.cy); SkipRow: @@ -1445,6 +1375,7 @@ UpdateScrollSize(); UpdateScrollPos(); OnScroll(0,0,TRUE); + m_Dib.SetSize(cx + m_szCell.cx, m_szCell.cy); } } Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2014-12-29 19:06:33 UTC (rev 4682) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2014-12-29 23:18:18 UTC (rev 4683) @@ -34,6 +34,7 @@ #include "SelectPluginDialog.h" #include "ExceptionHandler.h" #include "PatternClipboard.h" +#include "PatternFont.h" #include "../common/mptFileIO.h" #include "../common/FileReader.h" #include "../common/Profiler.h" @@ -155,9 +156,8 @@ HCURSOR CMainFrame::curNoDrop = NULL; HCURSOR CMainFrame::curNoDrop2 = NULL; HCURSOR CMainFrame::curVSplit = NULL; -LPMODPLUGDIB CMainFrame::bmpPatterns = NULL; -LPMODPLUGDIB CMainFrame::bmpNotes = NULL; -LPMODPLUGDIB CMainFrame::bmpVUMeters = NULL; +MODPLUGDIB *CMainFrame::bmpNotes = nullptr; +MODPLUGDIB *CMainFrame::bmpVUMeters = nullptr; COLORREF CMainFrame::gcolrefVuMeter[NUM_VUMETER_PENS*2]; CInputHandler *CMainFrame::m_InputHandler = nullptr; @@ -338,7 +338,6 @@ curNoDrop2 = theApp.LoadCursor(IDC_NODRAG); curVSplit = theApp.LoadCursor(AFX_IDC_HSPLITBAR); // bitmaps - bmpPatterns = LoadDib(MAKEINTRESOURCE(IDB_PATTERNS)); bmpNotes = LoadDib(MAKEINTRESOURCE(IDB_PATTERNVIEW)); bmpVUMeters = LoadDib(MAKEINTRESOURCE(IDB_VUMETERS)); // Toolbars @@ -394,24 +393,21 @@ } if (shMidiIn) midiCloseDevice(); // Delete bitmaps - if (bmpPatterns) - { - delete bmpPatterns; - bmpPatterns = NULL; - } if (bmpNotes) { delete bmpNotes; - bmpNotes = NULL; + bmpNotes = nullptr; } if (bmpVUMeters) { delete bmpVUMeters; - bmpVUMeters = NULL; + bmpVUMeters = nullptr; } + PatternFont::DeleteFontData(); + // Kill GDI Objects -#define DeleteGDIObject(h) if (h) { ::DeleteObject(h); h = NULL; } +#define DeleteGDIObject(h) ::DeleteObject(h); h = NULL; DeleteGDIObject(brushGray); DeleteGDIObject(penLightGray); DeleteGDIObject(penDarkGray); @@ -429,7 +425,6 @@ DeleteGDIObject(penGray99); DeleteGDIObject(penGraycc); DeleteGDIObject(penGrayff); - #undef DeleteGDIObject return CMDIFrameWnd::DestroyWindow(); @@ -1054,10 +1049,6 @@ //----------------------------- { COLORREF (&colors)[MAX_MODCOLORS] = TrackerSettings::Instance().rgbCustomColors; - if (bmpPatterns) - { - bmpPatterns->bmiColors[7] = rgb2quad(GetSysColor(COLOR_BTNFACE)); - } if (bmpVUMeters) { bmpVUMeters->bmiColors[7] = rgb2quad(GetSysColor(COLOR_BTNFACE)); Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2014-12-29 19:06:33 UTC (rev 4682) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2014-12-29 23:18:18 UTC (rev 4683) @@ -336,7 +336,7 @@ // static CBrush *pbrushBlack, *pbrushWhite; static HPEN penBlack, penDarkGray, penLightGray, penWhite, penHalfDarkGray, penSample, penEnvelope, penEnvelopeHighlight, penSeparator, penScratch, penGray00, penGray33, penGray40, penGray55, penGray80, penGray99, penGraycc, penGrayff; static HCURSOR curDragging, curNoDrop, curArrow, curNoDrop2, curVSplit; - static MODPLUGDIB *bmpPatterns, *bmpNotes, *bmpVUMeters; + static MODPLUGDIB *bmpNotes, *bmpVUMeters; static COLORREF gcolrefVuMeter[NUM_VUMETER_PENS * 2]; // General tab VU meters public: Modified: trunk/OpenMPT/mptrack/Moptions.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moptions.cpp 2014-12-29 19:06:33 UTC (rev 4682) +++ trunk/OpenMPT/mptrack/Moptions.cpp 2014-12-29 23:18:18 UTC (rev 4683) @@ -18,6 +18,7 @@ #include "Settings.h" #include "dlg_misc.h" #include "FileDialog.h" +#include "../common/StringFixer.h" OPENMPT_NAMESPACE_BEGIN @@ -55,6 +56,7 @@ BEGIN_MESSAGE_MAP(COptionsColors, CPropertyPage) ON_WM_DRAWITEM() ON_CBN_SELCHANGE(IDC_COMBO1, OnColorSelChanged) + ON_CBN_SELCHANGE(IDC_COMBO2, OnSettingsChanged) ON_EN_CHANGE(IDC_PRIMARYHILITE, OnSettingsChanged) ON_EN_CHANGE(IDC_SECONDARYHILITE, OnSettingsChanged) ON_COMMAND(IDC_BUTTON1, OnSelectColor1) @@ -64,6 +66,7 @@ ON_COMMAND(IDC_BUTTON6, OnPresetFT2) ON_COMMAND(IDC_BUTTON7, OnPresetIT) ON_COMMAND(IDC_BUTTON8, OnPresetBuzz) + ON_COMMAND(IDC_BUTTON9, OnChooseFont) ON_COMMAND(IDC_LOAD_COLORSCHEME, OnLoadColorScheme) ON_COMMAND(IDC_SAVE_COLORSCHEME, OnSaveColorScheme) ON_COMMAND(IDC_CHECK1, OnSettingsChanged) @@ -79,6 +82,7 @@ CPropertyPage::DoDataExchange(pDX); //{{AFX_DATA_MAP(COptionsColors) DDX_Control(pDX, IDC_COMBO1, m_ComboItem); + DDX_Control(pDX, IDC_COMBO2, m_ComboFont); DDX_Control(pDX, IDC_BUTTON1, m_BtnColor1); DDX_Control(pDX, IDC_BUTTON2, m_BtnColor2); DDX_Control(pDX, IDC_BUTTON3, m_BtnColor3); @@ -90,6 +94,13 @@ } +static std::string FormatFontName(const std::string fontName, int32_t fontSize) +//----------------------------------------------------------------------------- +{ + return fontName + ", " + mpt::ToString(fontSize / 10); +} + + BOOL COptionsColors::OnInitDialog() //--------------------------------- { @@ -104,11 +115,33 @@ m_BtnPreview.SetWindowPos(NULL, 0,0, PREVIEWBMP_WIDTH*2+2, PREVIEWBMP_HEIGHT*2+2, SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE); if (TrackerSettings::Instance().m_dwPatternSetup & PATTERN_STDHIGHLIGHT) CheckDlgButton(IDC_CHECK1, BST_CHECKED); if (TrackerSettings::Instance().m_dwPatternSetup & PATTERN_EFFECTHILIGHT) CheckDlgButton(IDC_CHECK2, BST_CHECKED); - if (TrackerSettings::Instance().m_dwPatternSetup & PATTERN_SMALLFONT) CheckDlgButton(IDC_CHECK3, BST_CHECKED); if (TrackerSettings::Instance().m_dwPatternSetup & PATTERN_2NDHIGHLIGHT) CheckDlgButton(IDC_CHECK4, BST_CHECKED); CheckDlgButton(IDC_CHECK5, TrackerSettings::Instance().rememberSongWindows ? BST_CHECKED : BST_UNCHECKED); SetDlgItemInt(IDC_PRIMARYHILITE, TrackerSettings::Instance().m_nRowHighlightMeasures); SetDlgItemInt(IDC_SECONDARYHILITE, TrackerSettings::Instance().m_nRowHighlightBeats); + + fontName = TrackerSettings::Instance().patternFont; + fontSize = TrackerSettings::Instance().patternFontSize; + fontFlags = TrackerSettings::Instance().patternFontFlags; + m_ComboFont.AddString("Built-in (small)"); + m_ComboFont.AddString("Built-in (large)"); + m_ComboFont.AddString("Built-in (small, x2)"); + m_ComboFont.AddString("Built-in (large, x2)"); + m_ComboFont.AddString("Built-in (small, x3)"); + m_ComboFont.AddString("Built-in (large, x3)"); + int sel = 0; + if(fontName == PATTERNFONT_SMALL) + { + sel = fontSize * 2; + } else if(fontName == PATTERNFONT_LARGE) + { + sel = fontSize * 2 + 1; + } else + { + m_ComboFont.AddString(FormatFontName(fontName, fontSize).c_str()); + sel = 6; + } + m_ComboFont.SetCurSel(sel); OnColorSelChanged(); return TRUE; @@ -135,13 +168,37 @@ void COptionsColors::OnOK() //------------------------- { - TrackerSettings::Instance().m_dwPatternSetup &= ~(PATTERN_STDHIGHLIGHT|PATTERN_2NDHIGHLIGHT|PATTERN_EFFECTHILIGHT|PATTERN_SMALLFONT); + TrackerSettings::Instance().m_dwPatternSetup &= ~(PATTERN_STDHIGHLIGHT|PATTERN_2NDHIGHLIGHT|PATTERN_EFFECTHILIGHT); if (IsDlgButtonChecked(IDC_CHECK1)) TrackerSettings::Instance().m_dwPatternSetup |= PATTERN_STDHIGHLIGHT; if (IsDlgButtonChecked(IDC_CHECK2)) TrackerSettings::Instance().m_dwPatternSetup |= PATTERN_EFFECTHILIGHT; - if (IsDlgButtonChecked(IDC_CHECK3)) TrackerSettings::Instance().m_dwPatternSetup |= PATTERN_SMALLFONT; if (IsDlgButtonChecked(IDC_CHECK4)) TrackerSettings::Instance().m_dwPatternSetup |= PATTERN_2NDHIGHLIGHT; TrackerSettings::Instance().rememberSongWindows = IsDlgButtonChecked(IDC_CHECK5) != BST_UNCHECKED; + std::string newName = fontName; + int32_t newSize = fontSize; + const int fontSel = m_ComboFont.GetCurSel(); + switch(fontSel) + { + case 0: + case 2: + case 4: + default: + newName = PATTERNFONT_SMALL; + newSize = fontSel / 2; + break; + case 1: + case 3: + case 5: + newName = PATTERNFONT_LARGE; + newSize = fontSel / 2; + break; + case 6: + break; + } + TrackerSettings::Instance().patternFont = newName; + TrackerSettings::Instance().patternFontSize = newSize; + TrackerSettings::Instance().patternFontFlags = fontFlags; + TrackerSettings::Instance().m_nRowHighlightMeasures = GetDlgItemInt(IDC_PRIMARYHILITE); TrackerSettings::Instance().m_nRowHighlightBeats = GetDlgItemInt(IDC_SECONDARYHILITE); @@ -161,6 +218,43 @@ } +void COptionsColors::OnChooseFont() +//--------------------------------- +{ + LOGFONT lf; + MemsetZero(lf); + const int32_t size = fontSize < 10 ? 120 : fontSize; + // Point size to pixels + lf.lfHeight = -MulDiv(size, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 720); + lf.lfWeight = (fontFlags & PatternFontBold) ? FW_BOLD : FW_NORMAL; + lf.lfItalic = (fontFlags & PatternFontItalic) ? TRUE : FALSE; + mpt::String::Copy(lf.lfFaceName, fontName); + CFontDialog dlg(&lf); + dlg.m_cf.hwndOwner = m_hWnd; + if(fontName != PATTERNFONT_SMALL && fontName != PATTERNFONT_LARGE) + { + dlg.m_cf.lpLogFont = &lf; + } + dlg.m_cf.Flags &= ~CF_EFFECTS; + dlg.m_cf.Flags |= /*CF_FIXEDPITCHONLY | */CF_FORCEFONTEXIST | CF_NOSCRIPTSEL; + if(dlg.DoModal() == IDOK) + { + while(m_ComboFont.GetCount() > 6) + { + m_ComboFont.DeleteString(6); + } + fontName = dlg.GetFaceName(); + fontSize = dlg.GetSize(); + fontFlags = 0; + if(dlg.IsBold()) fontFlags |= PatternFontBold; + if(dlg.IsItalic()) fontFlags |= PatternFontItalic; + m_ComboFont.AddString(FormatFontName(fontName, fontSize).c_str()); + m_ComboFont.SetCurSel(6); + OnSettingsChanged(); + } +} + + void COptionsColors::OnDrawItem(int nIdCtl, LPDRAWITEMSTRUCT lpdis) //----------------------------------------------------------------- { Modified: trunk/OpenMPT/mptrack/Moptions.h =================================================================== --- trunk/OpenMPT/mptrack/Moptions.h 2014-12-29 19:06:33 UTC (rev 4682) +++ trunk/OpenMPT/mptrack/Moptions.h 2014-12-29 23:18:18 UTC (rev 4683) @@ -82,10 +82,12 @@ protected: COLORREF CustomColors[MAX_MODCOLORS]; UINT m_nColorItem; - CComboBox m_ComboItem; + CComboBox m_ComboItem, m_ComboFont; CButton m_BtnColor1, m_BtnColor2, m_BtnColor3, m_BtnPreview; CStatic m_TxtColor1, m_TxtColor2, m_TxtColor3; - LPMODPLUGDIB m_pPreviewDib; + MODPLUGDIB *m_pPreviewDib; + std::string fontName; + int32_t fontSize, fontFlags; public: COptionsColors():CPropertyPage(IDD_OPTIONS_COLORS) { m_nColorItem = 0; m_pPreviewDib = NULL; } @@ -98,6 +100,7 @@ virtual void OnOK(); virtual void DoDataExchange(CDataExchange* pDX); virtual BOOL OnSetActive(); + afx_msg void OnChooseFont(); afx_msg void OnUpdateDialog(); afx_msg void OnDrawItem(int nIdCtl, LPDRAWITEMSTRUCT lpdis); afx_msg void OnColorSelChanged(); Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2014-12-29 19:06:33 UTC (rev 4682) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2014-12-29 23:18:18 UTC (rev 4683) @@ -1050,6 +1050,8 @@ if(firstRun) { + // On high-DPI devices, automatically upscale pattern font + TrackerSettings::Instance().patternFontSize = Clamp(::GetDeviceCaps(m_pMainWnd->GetDC()->m_hDC, LOGPIXELSX) / 96 - 1, 0, 9); new WelcomeDlg(m_pMainWnd); } @@ -1460,8 +1462,8 @@ } -void DibBlt(HDC hdc, int x, int y, int sizex, int sizey, int srcx, int srcy, LPMODPLUGDIB lpdib) -//---------------------------------------------------------------------------------------------- +void DibBlt(HDC hdc, int x, int y, int sizex, int sizey, int srcx, int srcy, MODPLUGDIB *lpdib) +//--------------------------------------------------------------------------------------------- { if (!lpdib) return; SetDIBitsToDevice( hdc, @@ -1479,8 +1481,8 @@ } -LPMODPLUGDIB LoadDib(LPCSTR lpszName) -//----------------------------------- +MODPLUGDIB *LoadDib(LPCSTR lpszName) +//---------------------------------- { HINSTANCE hInstance = AfxGetInstanceHandle(); HRSRC hrsrc = FindResource(hInstance, lpszName, RT_BITMAP); @@ -1488,7 +1490,7 @@ LPBITMAPINFO p = (LPBITMAPINFO)LockResource(hglb); if (p) { - LPMODPLUGDIB pmd = new MODPLUGDIB; + MODPLUGDIB *pmd = new MODPLUGDIB; pmd->bmiHeader = p->bmiHeader; for (int i=0; i<16; i++) pmd->bmiColors[i] = p->bmiColors[i]; LPBYTE lpDibBits = (LPBYTE)p; @@ -1557,17 +1559,17 @@ // useful for lots of small blits with color mapping // combined in one big blit -void CFastBitmap::Init(LPMODPLUGDIB lpTextDib) -//-------------------------------------------- +void CFastBitmap::Init(MODPLUGDIB *lpTextDib) +//------------------------------------------- { m_nBlendOffset = 0; m_pTextDib = lpTextDib; - MemsetZero(m_Dib); + MemsetZero(m_Dib.bmiHeader); m_nTextColor = 0; m_nBkColor = 1; m_Dib.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - m_Dib.bmiHeader.biWidth = FASTBMP_MAXWIDTH; - m_Dib.bmiHeader.biHeight = FASTBMP_MAXHEIGHT; + m_Dib.bmiHeader.biWidth = 0; // Set later + m_Dib.bmiHeader.biHeight = 0; // Ditto m_Dib.bmiHeader.biPlanes = 1; m_Dib.bmiHeader.biBitCount = 8; m_Dib.bmiHeader.biCompression = BI_RGB; @@ -1593,10 +1595,10 @@ cx, cy, 0, - FASTBMP_MAXHEIGHT - cy, + m_Dib.bmiHeader.biHeight - cy, 0, - FASTBMP_MAXHEIGHT, - m_Dib.DibBits, + m_Dib.bmiHeader.biHeight, + &m_Dib.DibBits[0], (LPBITMAPINFO)&m_Dib, DIB_RGB_COLORS); } @@ -1643,10 +1645,10 @@ // Monochrome 4-bit bitmap (0=text, !0 = back) -void CFastBitmap::TextBlt(int x, int y, int cx, int cy, int srcx, int srcy, LPMODPLUGDIB lpdib) -//--------------------------------------------------------------------------------------------- +void CFastBitmap::TextBlt(int x, int y, int cx, int cy, int srcx, int srcy, MODPLUGDIB *lpdib) +//-------------------------------------------------------------------------------------------- { - const BYTE *psrc; + const uint8_t *psrc; BYTE *pdest; UINT x1, x2; int srcwidth, srcinc; @@ -1663,9 +1665,9 @@ cy += y; y = 0; } - if ((x >= FASTBMP_MAXWIDTH) || (y >= FASTBMP_MAXHEIGHT)) return; - if (x+cx >= FASTBMP_MAXWIDTH) cx = FASTBMP_MAXWIDTH - x; - if (y+cy >= FASTBMP_MAXHEIGHT) cy = FASTBMP_MAXHEIGHT - y; + if ((x >= m_Dib.bmiHeader.biWidth) || (y >= m_Dib.bmiHeader.biHeight)) return; + if (x+cx >= m_Dib.bmiHeader.biWidth) cx = m_Dib.bmiHeader.biWidth - x; + if (y+cy >= m_Dib.bmiHeader.biHeight) cy = m_Dib.bmiHeader.biHeight - y; if (!lpdib) lpdib = m_pTextDib; if ((cx <= 0) || (cy <= 0) || (!lpdib)) return; srcwidth = (lpdib->bmiHeader.biWidth+1) >> 1; @@ -1677,11 +1679,11 @@ } x1 = srcx & 1; x2 = x1 + cx; - pdest = m_Dib.DibBits + ((FASTBMP_MAXHEIGHT - 1 - y) << FASTBMP_XSHIFT) + x; + pdest = &m_Dib.DibBits[((m_Dib.bmiHeader.biHeight - 1 - y) << m_nXShiftFactor) + x]; psrc = lpdib->lpDibBits + (srcx >> 1) + (srcy * srcwidth); for (int iy=0; iy<cy; iy++) { - LPBYTE p = pdest; + uint8_t *p = pdest; UINT ix = x1; if (ix&1) { @@ -1702,12 +1704,37 @@ UINT b = psrc[ix >> 1]; *p++ = m_n4BitPalette[b >> 4]+m_nBlendOffset; } - pdest -= FASTBMP_MAXWIDTH; + pdest -= m_Dib.bmiHeader.biWidth; psrc += srcinc; } } +void CFastBitmap::SetSize(int x, int y) +//------------------------------------- +{ + if(x > 4) + { + // Compute the required shift factor for obtaining a power-of-two bitmap width + m_nXShiftFactor = 1; + x--; + while(x >>= 1) + { + m_nXShiftFactor++; + } + } else + { + // Bitmaps rows are aligned to 4 bytes, so let this bitmap be exactly 4 pixels wide. + m_nXShiftFactor = 2; + } + + x = (1 << m_nXShiftFactor); + if(m_Dib.DibBits.size() != static_cast<size_t>(y << m_nXShiftFactor)) m_Dib.DibBits.resize(y << m_nXShiftFactor); + m_Dib.bmiHeader.biWidth = x; + m_Dib.bmiHeader.biHeight = y; +} + + /////////////////////////////////////////////////////////////////////////////////// // // DirectX Plugins Modified: trunk/OpenMPT/mptrack/Mptrack.h =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.h 2014-12-29 19:06:33 UTC (rev 4682) +++ trunk/OpenMPT/mptrack/Mptrack.h 2014-12-29 23:18:18 UTC (rev 4683) @@ -40,7 +40,7 @@ BITMAPINFOHEADER bmiHeader; RGBQUAD bmiColors[16]; LPBYTE lpDibBits; -} MODPLUGDIB, *LPMODPLUGDIB; +} MODPLUGDIB; ///////////////////////////////////////////////////////////////////////////// @@ -344,50 +344,48 @@ ////////////////////////////////////////////////////////////////// // More Bitmap Helpers -//#define FASTBMP_XSHIFT 12 // 4K pixels -#define FASTBMP_XSHIFT 13 // 8K pixels -#define FASTBMP_MAXWIDTH (1 << FASTBMP_XSHIFT) -#define FASTBMP_MAXHEIGHT 16 - -struct MODPLUGFASTDIB -{ - BITMAPINFOHEADER bmiHeader; - RGBQUAD bmiColors[256]; - BYTE DibBits[FASTBMP_MAXWIDTH*FASTBMP_MAXHEIGHT]; -}; - //=============== class CFastBitmap //=============== { protected: + struct MODPLUGFASTDIB + { + BITMAPINFOHEADER bmiHeader; + RGBQUAD bmiColors[256]; + std::vector<uint8_t> DibBits; + }; + MODPLUGFASTDIB m_Dib; UINT m_nTextColor, m_nBkColor; - LPMODPLUGDIB m_pTextDib; - BYTE m_nBlendOffset; - BYTE m_n4BitPalette[16]; + MODPLUGDIB *m_pTextDib; + uint8_t m_nBlendOffset; + uint8_t m_n4BitPalette[16]; + uint8_t m_nXShiftFactor; public: CFastBitmap() {} public: - void Init(LPMODPLUGDIB lpTextDib=NULL); + void Init(MODPLUGDIB *lpTextDib = nullptr); void Blit(HDC hdc, int x, int y, int cx, int cy); void Blit(HDC hdc, LPCRECT lprc) { Blit(hdc, lprc->left, lprc->top, lprc->right-lprc->left, lprc->bottom-lprc->top); } void SetTextColor(int nText, int nBk=-1) { m_nTextColor = nText; if (nBk >= 0) m_nBkColor = nBk; } void SetTextBkColor(UINT nBk) { m_nBkColor = nBk; } void SetColor(UINT nIndex, COLORREF cr); void SetAllColors(UINT nBaseIndex, UINT nColors, COLORREF *pcr); - void TextBlt(int x, int y, int cx, int cy, int srcx, int srcy, LPMODPLUGDIB lpdib=NULL); + void TextBlt(int x, int y, int cx, int cy, int srcx, int srcy, MODPLUGDIB *lpdib = nullptr); void SetBlendMode(BYTE nBlendOfs) { m_nBlendOffset = nBlendOfs; } void SetBlendColor(COLORREF cr); + void SetSize(int x, int y); + int GetWidth() const { return m_Dib.bmiHeader.biWidth; } }; /////////////////////////////////////////////////// // 4-bit DIB Drawing functions -void DibBlt(HDC hdc, int x, int y, int sizex, int sizey, int srcx, int srcy, LPMODPLUGDIB lpdib); -LPMODPLUGDIB LoadDib(LPCSTR lpszName); +void DibBlt(HDC hdc, int x, int y, int sizex, int sizey, int srcx, int srcy, MODPLUGDIB *lpdib); +MODPLUGDIB *LoadDib(LPCSTR lpszName); RGBQUAD rgb2quad(COLORREF c); // Other bitmap functions Added: trunk/OpenMPT/mptrack/PatternFont.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternFont.cpp (rev 0) +++ trunk/OpenMPT/mptrack/PatternFont.cpp 2014-12-29 23:18:18 UTC (rev 4683) @@ -0,0 +1,416 @@ +/* + * PatternFont.cpp + * --------------- + * Purpose: Code for creating pattern font bitmaps + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#include "stdafx.h" +#include "PatternFont.h" +#include "Mptrack.h" +#include "Mainfrm.h" +#include "TrackerSettings.h" + +OPENMPT_NAMESPACE_BEGIN + +////////////////////////////////////////////// +// Font Definitions + +// Medium Font (Default) +const PATTERNFONT gDefaultPatternFont = +{ + nullptr, + 92,13, // Column Width & Height + 0,0, // Clear location + 130,8, // Space Location. + {20, 20, 24, 9, 15}, // Element Widths + {0, 0, 0, 0, 0}, // Padding pixels contained in element width + 20,13, // Numbers 0-F (hex) + 30,13, // Numbers 10-29 (dec) + 64,26, // A-M# + 78,26, // N-Z? // MEDIUM FONT !!! + 0, 0, + 12,8, // Note & Octave Width + 42,13, // Volume Column Effects + 8,8, + -1, + 8, // 8+7 = 15 + -3, -1, 12, + 1, // Margin for first digit of PC event parameter number + 2, // Margin for first digit of PC event parameter value + 1, // Margin for second digit of parameter + 13, // Vertical spacing between letters in the bitmap +}; + + +////////////////////////////////////////////////// +// Small Font + +const PATTERNFONT gSmallPatternFont = +{ + nullptr, + 70,11, // Column Width & Height + 92,0, // Clear location + 130,8, // Space Location. + {16, 14, 18, 7, 11}, // Element Widths + {0, 0, 0, 0, 0}, // Padding pixels contained in element width + 108,13, // Numbers 0-F (hex) + 120,13, // Numbers 10-29 (dec) + 142,26, // A-M# + 150,26, // N-Z? // SMALL FONT !!! + 92, 0, // Notes + 10,6, // Note & Octave Width + 132,13, // Volume Column Effects + 6,5, + -1, + 6, // 8+7 = 15 + -3, 1, 9, // InstrOfs + nInstrHiWidth + 1, // Margin for first digit of PC event parameter number + 2, // Margin for first digit of PC event parameter value + 1, // Margin for second digit of parameter + 13, // // Vertical spacing between letters in the bitmap +}; + +// NOTE: See also CViewPattern::DrawNote() when changing stuff here +// or adding new fonts - The custom tuning note names might require +// some additions there. + +const PATTERNFONT *PatternFont::currentFont = nullptr; + +static MODPLUGDIB customFontBitmap; + +static void DrawChar(HDC hDC, WCHAR ch, int x, int y, int w, int h) +//----------------------------------------------------------------- +{ + CRect rect(x, y, x + w, y + h); + ::DrawTextW(hDC, &ch, 1, &rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE); +} + +static void DrawChar(HDC hDC, CHAR ch, int x, int y, int w, int h) +//---------------------------------------------------------------- +{ + CRect rect(x, y, x + w, y + h); + ::DrawTextA(hDC, &ch, 1, &rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE); +} + +template<typename char_t> +static void DrawString(HDC hDC, const char_t *text, int len, int x, int y, int w, int h) +//-------------------------------------------------------------------------------------- +{ + for(int i = 0; i < len; i++) + { + DrawChar(hDC, text[i], x, y, w, h); + x += w; + } +} + +void PatternFont::UpdateFont(CDC *dc) +//----------------------------------- +{ + const std::string name = TrackerSettings::Instance().patternFont; + int32_t fontSize = TrackerSettings::Instance().patternFontSize; + int32_t flags = TrackerSettings::Instance().patternFontFlags; + const PATTERNFONT *builtinFont = nullptr; + if(name == PATTERNFONT_SMALL || name.empty()) + { + builtinFont = &gSmallPatternFont; + } else if(name == PATTERNFONT_LARGE) + { + builtinFont = &gDefaultPatternFont; + } + + if(builtinFont != nullptr && fontSize < 1) + { + currentFont = builtinFont; + return; + } + + static PATTERNFONT pf = { 0 }; + currentFont = &pf; + + static std::string previousFont; + static int32_t previousSize, previousFlags; + if(previousFont == name && previousSize == fontSize && previousFlags == flags) + { + // Nothing to do + return; + } + previousFont = name; + previousSize = fontSize; + previousFlags = flags; + DeleteFontData(); + pf.dib = &customFontBitmap; + + // Upscale built-in font? + if(builtinFont != nullptr) + { + // Copy and scale original 4-bit bitmap + LimitMax(fontSize, 10); + fontSize++; + MemCopy(customFontBitmap.bmiHeader, CMainFrame::bmpNotes->bmiHeader); + customFontBitmap.bmiHeader.biWidth *= fontSize; + customFontBitmap.bmiHeader.biHeight *= fontSize; + customFontBitmap.bmiHeader.biSizeImage = customFontBitmap.bmiHeader.biWidth * customFontBitmap.bmiHeader.biHeight / 2; + customFontBitmap.lpDibBits = new uint8_t[customFontBitmap.bmiHeader.biSizeImage]; + + // Upscale the image (ugly code ahead) + const uint8_t *origPixels = CMainFrame::bmpNotes->lpDibBits; + uint8_t *scaledPixels = customFontBitmap.lpDibBits; + const int bytesPerLine = customFontBitmap.bmiHeader.biWidth / 2, scaleBytes = bytesPerLine * fontSize; + bool outPos = false; + for(int y = 0; y < CMainFrame::bmpNotes->bmiHeader.biHeight; y++, scaledPixels += scaleBytes - bytesPerLine) + { + for(int x = 0; x < CMainFrame::bmpNotes->bmiHeader.biWidth; x++) + { + uint8_t pixel = *origPixels; + if(x % 2u == 0) + { + pixel >>= 4; + } else + { + pixel &= 0x0F; + origPixels++; + } + for(int scaleX = 0; scaleX < fontSize; scaleX++) + { + if(!outPos) + { + for(int scaleY = 0; scaleY < scaleBytes; scaleY += bytesPerLine) + { + scaledPixels[scaleY] = pixel << 4; + } + } else + { + for(int scaleY = 0; scaleY < scaleBytes; scaleY += bytesPerLine) + { + scaledPixels[scaleY] |= pixel; + } + scaledPixels++; + } + outPos = !outPos; + } + } + } + pf.nWidth = (builtinFont->nWidth - 4) * fontSize + 4; + pf.nHeight = builtinFont->nHeight * fontSize; + pf.nClrX = builtinFont->nClrX * fontSize; + pf.nClrY = builtinFont->nClrY * fontSize; + pf.nSpaceX = builtinFont->nSpaceX * fontSize; + pf.nSpaceY = builtinFont->nSpaceY * fontSize; + for(size_t i = 0; i < CountOf(pf.nEltWidths); i++) + { + pf.nEltWidths[i] = builtinFont->nEltWidths[i] * fontSize; + pf.padding[i] = builtinFont->padding[i] * fontSize; + } + pf.nNumX = builtinFont->nNumX * fontSize; + pf.nNumY = builtinFont->nNumY * fontSize; + pf.nNum10X = builtinFont->nNum10X * fontSize; + pf.nNum10Y = builtinFont->nNum10Y * fontSize; + pf.nAlphaAM_X = builtinFont->nAlphaAM_X * fontSize; + pf.nAlphaAM_Y = builtinFont->nAlphaAM_Y * fontSize; + pf.nAlphaNZ_X = builtinFont->nAlphaNZ_X * fontSize; + pf.nAlphaNZ_Y = builtinFont->nAlphaNZ_Y * fontSize; + pf.nNoteX = builtinFont->nNoteX * fontSize; + pf.nNoteY = builtinFont->nNoteY * fontSize; + pf.nNoteWidth = builtinFont->nNoteWidth * fontSize; + pf.nOctaveWidth = builtinFont->nOctaveWidth * fontSize; + pf.nVolX = builtinFont->nVolX * fontSize; + pf.nVolY = builtinFont->nVolY * fontSize; + pf.nVolCmdWidth = builtinFont->nVolCmdWidth * fontSize; + pf.nVolHiWidth = builtinFont->nVolHiWidth * fontSize; + pf.nCmdOfs = builtinFont->nCmdOfs * fontSize; + pf.nParamHiWidth = builtinFont->nParamHiWidth * fontSize; + pf.nInstrOfs = builtinFont->nInstrOfs * fontSize; + pf.nInstr10Ofs = builtinFont->nInstr10Ofs * fontSize; + pf.nInstrHiWidth = builtinFont->nInstrHiWidth * fontSize; + pf.pcParamMargin = builtinFont->pcParamMargin * fontSize; + pf.pcValMargin = builtinFont->pcValMargin * fontSize; + pf.paramLoMargin = builtinFont->paramLoMargin * fontSize; + pf.spacingY = builtinFont->spacingY * fontSize; + + // Create 4-pixel border + const int bmWidth2 = pf.dib->bmiHeader.biWidth / 2; + for(int y = 0, x = pf.nClrY * bmWidth2 + (pf.nClrX + pf.nWidth - 4) / 2; y < pf.nHeight; y++, x += bmWidth2) + { + pf.dib->lpDibBits[x] = 0xEC; + pf.dib->lpDibBits[x + 1] = 0xC4; + } + + return; + } + + // Create our own font! + // Point size to pixels + fontSize = -MulDiv(fontSize, GetDeviceCaps(dc->m_hDC, LOGPIXELSY), 720); + + CDC hDC; + hDC.CreateCompatibleDC(dc); + + CFont font; + font.CreateFont(fontSize, 0, 0, 0, (flags & PatternFontBold) ? FW_BOLD : FW_NORMAL, (flags & PatternFontItalic) ? TRUE : FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_RASTER_PRECIS, CLIP_DEFAULT_PRECIS, NONANTIALIASED_QUALITY, FIXED_PITCH | FF_DONTCARE, name.c_str()); + CFont *oldFont = hDC.SelectObject(&font); + + CPoint pt = hDC.GetTextExtent(_T("W")); + const int charWidth = pt.x, charHeight = pt.y; + const int spacing = charWidth / 4; + const int width = charWidth * 12 + spacing * 2 + 4, height = charHeight * 21; + + pf.nWidth = width; // Column Width & Height, including 4-pixels border + pf.nHeight = charHeight; + pf.nClrX = pf.nClrY = 0; // Clear (empty note) location + pf.nSpaceX = charWidth * 7; // White location (must be big enough) + pf.nSpaceY = charHeight; + pf.nEltWidths[0] = charWidth * 3; // Note + pf.padding[0] = 0; + pf.nEltWidths[1] = charWidth * 3 + spacing; // Instr + pf.padding[1] = spacing; + pf.nEltWidths[2] = charWidth * 3 + spacing; // Volume + pf.padding[2] = spacing; + pf.nEltWidths[3] = charWidth; // Command letter + pf.padding[3] = 0; + pf.nEltWidths[4] = charWidth * 2; // Command param + pf.padding[4] = 0; + pf.nNumX = charWidth * 3; // Vertically-oriented numbers 0x00-0x0F + pf.nNumY = charHeight; + pf.nNum10X = charWidth * 4; // Numbers 10-29 + pf.nNum10Y = charHeight; + pf.nAlphaAM_X = charWidth * 6; // Letters A-M +# + pf.nAlphaAM_Y = charHeight * 2; + pf.nAlphaNZ_X = charWidth * 7; // Letters N-Z +? + pf.nAlphaNZ_Y = charHeight * 2; + pf.nNoteX = 0; // Notes ..., C-, C#, ... + pf.nNoteY = 0; + pf.nNoteWidth = charWidth * 2; // Total width of note (C#) + pf.nOctaveWidth = charWidth; // Octave Width + pf.nVolX = charWidth * 8; // Volume Column Effects + pf.nVolY = charHeight; + pf.nVolCmdWidth = charWidth; // Width of volume effect + pf.nVolHiWidth = charWidth; // Width of first character in volume parameter + pf.nCmdOfs = 0; // XOffset (-xxx) around the command letter + pf.nParamHiWidth = charWidth; + pf.nInstrOfs = -charWidth; + pf.nInstr10Ofs = 0; + pf.nInstrHiWidth = charWidth * 2; + pf.pcParamMargin = 0; + pf.pcValMargin = 0; + pf.paramLoMargin = 0; // Margin for second digit of parameter + pf.spacingY = charHeight; + + pf.dib->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pf.dib->bmiHeader.biWidth = ((width + 7) & ~7); // 4-byte alignment + pf.dib->bmiHeader.biHeight = -(int32_t)height; + pf.dib->bmiHeader.biSizeImage = pf.dib->bmiHeader.biWidth * height / 2; + pf.dib->bmiHeader.biPlanes = 1; + pf.dib->bmiHeader.biBitCount = 4; + pf.dib->bmiHeader.biCompression = BI_RGB; + pf.dib->lpDibBits = new uint8_t[pf.dib->bmiHeader.biSizeImage]; + pf.dib->bmiColors[0] = rgb2quad(RGB(0x00, 0x00, 0x00)); + pf.dib->bmiColors[15] = rgb2quad(RGB(0xFF, 0xFF, 0xFF)); + + uint8_t *data = nullptr; + HBITMAP bitmap = ::CreateDIBSection(hDC, (BITMAPINFO *)&pf.dib->bmiHeader, DIB_RGB_COLORS, (void **)&data, nullptr, 0); + if(data == nullptr) + { + hDC.SelectObject(oldFont); + font.DeleteObject(); + hDC.DeleteDC(); + currentFont = &gDefaultPatternFont; + return; + } + HGDIOBJ oldBitmap = hDC.SelectObject(bitmap); + + hDC.FillSolidRect(0, 0, width - 4, height, RGB(0xFF, 0xFF, 0xFF)); + hDC.SetTextColor(RGB(0x00, 0x00, 0x00)); + hDC.SetBkColor(RGB(0xFF, 0xFF, 0xFF)); + hDC.SetTextAlign(TA_TOP | TA_LEFT); + + // Empty cells (dots - i-th bit set = dot in the i-th column of a cell) + const uint8_t dots[5] = { 1 | 2 | 4, 2 | 4, 2 | 4, 1, 1 | 2 }; + for(size_t cell = 0, offset = 0; cell < CountOf(dots); cell++) + { + uint8_t dot = dots[cell]; + for(int i = 0; dot != 0; i++) + { + if(dot & 1) DrawChar(hDC, L'\u00B7', pf.nClrX + offset + i * charWidth, pf.nClrY, charWidth, charHeight); + dot >>= 1; + } + offset += pf.nEltWidths[cell]; + } + + // Notes + for(int i = 0; i < 12; i++) + { + DrawString(hDC, szNoteNames[i], 2, pf.nNoteX, pf.nNoteY + (i + 1) * charHeight, charWidth, charHeight); + } + DrawString(hDC, "^^", 2, pf.nNoteX, pf.nNoteY + 13 * charHeight, charWidth, charHeight); + DrawString(hDC, "==", 2, pf.nNoteX, pf.nNoteY + 14 * charHeight, charWidth, charHeight); + DrawString(hDC, "PC", 2, pf.nNoteX, pf.nNoteY + 15 * charHeight, charWidth, charHeight); + DrawString(hDC, "PCs", 3, pf.nNoteX, pf.nNoteY + 16 * charHeight, charWidth, charHeight); + DrawString(hDC, "~~", 2, pf.nNoteX, pf.nNoteY + 17 * charHeight, charWidth, charHeight); + + // Hex chars + const char hexChars[] = "0123456789ABCDEF"; + for(int i = 0; i < 16; i++) + { + DrawChar(hDC, hexChars[i], pf.nNumX, pf.nNumY + i * charHeight, charWidth, charHeight); + } + // Double-digit numbers + for(int i = 0; i < 20; i++) + { + char s[2]; + s[0] = char('1' + i / 10); + s[1] = char('0' + i % 10); + DrawString(hDC, s, 2, pf.nNum10X, pf.nNum10Y + i * charHeight, charWidth, charHeight); + } + + // Volume commands + const char volEffects[]= " vpcdabuhlrgfe:o"; + STATIC_ASSERT(CountOf(volEffects) - 1 == MAX_VOLCMDS); + for(int i = 0; i < MAX_VOLCMDS; i++) + { + DrawChar(hDC, volEffects[i], pf.nVolX, pf.nVolY + i * charHeight, charWidth, charHeight); + } + + // Letters A-Z + for(int i = 0; i < 13; i++) + { + DrawChar(hDC, char('A' + i), pf.nAlphaAM_X, pf.nAlphaAM_Y + i * charHeight, charWidth, charHeight); + DrawChar(hDC, char('N' + i), pf.nAlphaNZ_X, pf.nAlphaNZ_Y + i * charHeight, charWidth, charHeight); + } + // Special chars + DrawChar(hDC, '#', pf.nAlphaAM_X, pf.nAlphaAM_Y + 13 * charHeight, charWidth, charHeight); + DrawChar(hDC, '?', pf.nAlphaNZ_X, pf.nAlphaNZ_Y + 13 * charHeight, charWidth, charHeight); + DrawChar(hDC, 'b', pf.nAlphaAM_X, pf.nAlphaAM_Y + 14 * charHeight, charWidth, charHeight); + DrawChar(hDC, '\\', pf.nAlphaNZ_X, pf.nAlphaNZ_Y + 14 * charHeight, charWidth, charHeight); + DrawChar(hDC, '-', pf.nAlphaAM_X, pf.nAlphaAM_Y + 15 * charHeight, charWidth, charHeight); + DrawChar(hDC, ':', pf.nAlphaNZ_X, pf.nAlphaNZ_Y + 15 * charHeight, charWidth, charHeight); + + ::GdiFlush(); + std::memcpy(pf.dib->lpDibBits, data, pf.dib->bmiHeader.biSizeImage); + // Create 4-pixel border + const int bmWidth2 = pf.dib->bmiHeader.biWidth / 2; + for(int y = 0, x = width / 2 - 2; y < height; y++, x += bmWidth2) + { + pf.dib->lpDibBits[x] = 0xEC; + pf.dib->lpDibBits[x + 1] = 0xC4; + } + + hDC.SelectObject(oldBitmap); + hDC.SelectObject(oldFont); + font.DeleteObject(); + DeleteBitmap(bitmap); + hDC.DeleteDC(); +} + + +void PatternFont::DeleteFontData() +//-------------------------------- +{ + delete[] customFontBitmap.lpDibBits; + customFontBitmap.lpDibBits = nullptr; +} + +OPENMPT_NAMESPACE_END Property changes on: trunk/OpenMPT/mptrack/PatternFont.cpp ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-c++src \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/mptrack/PatternFont.h =================================================================== --- trunk/OpenMPT/mptrack/PatternFont.h (rev 0) +++ trunk/OpenMPT/mptrack/PatternFont.h 2014-12-29 23:18:18 UTC (rev 4683) @@ -0,0 +1,53 @@ +/* + * PatternFont.h + * ------------- + * Purpose: Code for creating pattern font bitmaps + * Notes : (currently none) + * Authors: OpenMPT Devs + * The OpenMPT source code is released under the BSD license. Read LICENSE for more details. + */ + + +#pragma once + +OPENMPT_NAMESPACE_BEGIN + +struct MODPLUGDIB; + +struct PATTERNFONT +{ + MODPLUGDIB *dib; + int nWidth, nHeight; // Column Width & Height, including 4-pixels border + int nClrX, nClrY; // Clear (empty note) location + int nSpaceX, nSpaceY; // White location (must be big enough) + UINT nEltWidths[5]; // Elements Sizes + UINT padding[5]; // Padding pixels contained in element width + int nNumX, nNumY; // Vertically-oriented numbers 0x00-0x0F + int nNum10X, nNum10Y; // Numbers 10-29 + int nAlphaAM_X,nAlphaAM_Y; // Letters A-M +# + int nAlphaNZ_X,nAlphaNZ_Y; // Letters N-Z +? + int nNoteX, nNoteY; // Notes ..., C-, C#, ... + int nNoteWidth; // Total width of note (C#) + int nOctaveWidth; // Octave Width + int nVolX, nVolY; // Volume Column Effects + int nVolCmdWidth; // Width of volume effect + int nVolHiWidth; // Width of first character in volume parameter + int nCmdOfs; // XOffset (-xxx) around the command letter + int nParamHiWidth; + int nInstrOfs, nInstr10Ofs, nInstrHiWidth; + int pcParamMargin; // Margin for first digit of PC event parameter number + int pcValMargin; // Margin for first digit of PC event parameter value + int paramLoMargin; // Margin for second digit of parameter + int spacingY; // Vertical spacing between letters in the bitmap +}; + +class PatternFont +{ +public: + static const PATTERNFONT *currentFont; + + static void UpdateFont(CDC *dc); + static void DeleteFontData(); +}; + +OPENMPT_NAMESPACE_END \ No newline at end of file Property changes on: trunk/OpenMPT/mptrack/PatternFont.h ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-chdr \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-29 19:06:33 UTC (rev 4682) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-29 23:18:18 UTC (rev 4683) @@ -105,7 +105,7 @@ //------------------------------------ { return PATTERN_PLAYNEWNOTE | PATTERN_EFFECTHILIGHT - | PATTERN_SMALLFONT | PATTERN_CENTERROW | PATTERN_DRAGNDROPEDIT + | PATTERN_CENTERROW | PATTERN_DRAGNDROPEDIT | PATTERN_FLATBUTTONS | PATTERN_NOEXTRALOUD | PATTERN_2NDHIGHLIGHT | PATTERN_STDHIGHLIGHT | PATTERN_SHOWPREVIOUS | PATTERN_CONTSCROLL | PATTERN_SYNCMUTE | PATTERN_AUTODELAY | PATTERN_NOTEFADE @@ -209,6 +209,9 @@ , gnAutoChordWaitTime(conf, "Pattern Editor", "AutoChordWaitTime", 60) , orderlistMargins(conf, "Pattern Editor", "DefaultSequenceMargins", 0) , rowDisplayOffset(conf, "Pattern Editor", "RowDisplayOffset", 0) + , patternFont(conf, "Pattern Editor", "Font", PATTERNFONT_SMALL) + , patternFontSize(conf, "Pattern Editor", "Font Size", 0) + , patternFontFlags(conf, "Pattern Editor", "Font Flags", 0) // Sample Editor , m_SampleUndoBufferSize(conf, "Sample Editor", "UndoBufferSize", SampleUndoBufferSize()) , sampleEditorKeyBehaviour(conf, "Sample Editor", "KeyBehaviour", seNoteOffOnNewKey) @@ -531,6 +534,14 @@ { m_dwPatternSetup &= ~0x10000000; // ditto } + if(storedVersion < MAKE_VERSION_NUMERIC(1,24,01,02)) + { + if(m_dwPatternSetup & 0x08) + patternFont = PATTERNFONT_SMALL; + else + patternFont = PATTERNFONT_LARGE; + m_dwPatternSetup &= ~0x08; + } // Effects #ifndef NO_EQ Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-29 19:06:33 UTC (rev 4682) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-29 23:18:18 UTC (rev 4683) @@ -90,7 +90,7 @@ #define PATTERN_PLAYNEWNOTE 0x01 // play new notes while recording #define PATTERN_LARGECOMMENTS 0x02 // use large font in comments #define PATTERN_STDHIGHLIGHT 0x04 // enable primary highlight (measures) -#define PATTERN_SMALLFONT 0x08 // use small font in pattern editor +//#define PATTERN_SMALLFONT 0x08 // use small font in pattern editor #define PATTERN_CENTERROW 0x10 // always center active row #define PATTERN_WRAP 0x20 // wrap around cursor in editor #define PATTERN_EFFECTHILIGHT 0x40 // effect syntax highlighting @@ -120,6 +120,8 @@ #define PATTERN_LIVEUPDATETREE 0x40000000 // update active sample / instr icons in treeview #define PATTERN_SYNCSAMPLEPOS 0x80000000 // sync sample positions when seeking +#define PATTERNFONT_SMALL "@1" +#define PATTERNFONT_LARGE "@2" // Midi Setup #define MIDISETUP_RECORDVELOCITY 0x01 // Record MIDI velocity @@ -317,6 +319,12 @@ SoundDeviceStopModePlaying = 2, }; +enum FontFlags +{ + PatternFontBold = 1, + PatternFontItalic = 2, +}; + template<> inline SettingValue ToSettingValue(const SoundDeviceStopMode &val) { return SettingValue(static_cast<int32>(val)); @@ -443,6 +451,9 @@ CachedSetting<UINT> gnAutoChordWaitTime; CachedSetting<int32> orderlistMargins; CachedSetting<int32> rowDispla... [truncated message content] |
From: <man...@us...> - 2014-12-30 10:44:24
|
Revision: 4684 http://sourceforge.net/p/modplug/code/4684 Author: manxorist Date: 2014-12-30 10:44:08 +0000 (Tue, 30 Dec 2014) Log Message: ----------- [New] Add hidden setting [Debug]StopSoundDeviceOnCrash (default true), which can be disabled in order to debug sound device related problems which is otherwise completely unfeasable because the whole sound device state gets mangled by the crash dumper. [New] Add hidden setting [Debug]TraceAlwaysDump (default false) which causes the trace log (when enabled via [Debug]TraceEnable) to always be written on program exit. This is again useful to debug sound device related problems that do not manifest in a crash. [Ref] Restructure the crash handling code. [Mod] OpenMPT: Version is now 1.24.01.03 Modified Paths: -------------- trunk/OpenMPT/common/Logging.cpp trunk/OpenMPT/common/Logging.h trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/ExceptionHandler.cpp trunk/OpenMPT/mptrack/ExceptionHandler.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h Modified: trunk/OpenMPT/common/Logging.cpp =================================================================== --- trunk/OpenMPT/common/Logging.cpp 2014-12-29 23:18:18 UTC (rev 4683) +++ trunk/OpenMPT/common/Logging.cpp 2014-12-30 10:44:08 UTC (rev 4684) @@ -302,9 +302,6 @@ // sort according to index in case of overflows std::stable_sort(Entries.begin(), Entries.end()); - WCHAR tmp[1024]; - GetCurrentDirectoryW(1023, tmp); - mpt::ofstream f(filename, std::ios::out); f << "Build: OpenMPT " << MptVersion::GetVersionStringExtended() << std::endl; Modified: trunk/OpenMPT/common/Logging.h =================================================================== --- trunk/OpenMPT/common/Logging.h 2014-12-29 23:18:18 UTC (rev 4683) +++ trunk/OpenMPT/common/Logging.h 2014-12-30 10:44:08 UTC (rev 4684) @@ -117,6 +117,7 @@ // if there are not multiple thread adding trace points at high frequency (way greater than 1000Hz), // which, in OpenMPT, is only ever the case for just a single thread (the audio thread), if at all. extern bool volatile g_Enabled; +static inline bool IsEnabled() { return g_Enabled; } noinline void Trace(const mpt::log::Context & contexxt); Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-12-29 23:18:18 UTC (rev 4683) +++ trunk/OpenMPT/common/versionNumber.h 2014-12-30 10:44:08 UTC (rev 4684) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 24 #define VER_MINOR 01 -#define VER_MINORMINOR 02 +#define VER_MINORMINOR 03 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/ExceptionHandler.cpp =================================================================== --- trunk/OpenMPT/mptrack/ExceptionHandler.cpp 2014-12-29 23:18:18 UTC (rev 4683) +++ trunk/OpenMPT/mptrack/ExceptionHandler.cpp 2014-12-30 10:44:08 UTC (rev 4684) @@ -23,66 +23,105 @@ bool ExceptionHandler::fullMemDump = false; +bool ExceptionHandler::stopSoundDeviceOnCrash = true; + + enum DumpMode { - DumpModeCrash = 0, - DumpModeWarning = 1, + DumpModeCrash = 0, // crash + DumpModeWarning = 1, // assert + DumpModeDebug = 2, // debug output (e.g. trace log) }; -static void GenerateDump(CString &errorMessage, _EXCEPTION_POINTERS *pExceptionInfo=NULL, DumpMode mode=DumpModeCrash) -//-------------------------------------------------------------------------------------------------------------------- +struct CrashOutputDirectory { - - // seal the trace log as early as possible - mpt::log::Trace::Seal(); - - CMainFrame* pMainFrame = CMainFrame::GetMainFrame(); - - const mpt::PathString timestampDir = mpt::PathString::FromCStringSilent((CTime::GetCurrentTime()).Format("%Y-%m-%d %H.%M.%S\\")); - mpt::PathString baseRescuePath; + bool valid; + mpt::PathString path; + CrashOutputDirectory() + : valid(true) { + const mpt::PathString timestampDir = mpt::PathString::FromCStringSilent((CTime::GetCurrentTime()).Format("%Y-%m-%d %H.%M.%S\\")); // Create a crash directory - baseRescuePath = Util::GetTempDirectory() + MPT_PATHSTRING("OpenMPT Crash Files\\"); - if(!baseRescuePath.IsDirectory()) + path = Util::GetTempDirectory() + MPT_PATHSTRING("OpenMPT Crash Files\\"); + if(!path.IsDirectory()) { - CreateDirectoryW(baseRescuePath.AsNative().c_str(), nullptr); + CreateDirectoryW(path.AsNative().c_str(), nullptr); } - baseRescuePath += timestampDir; - if(!baseRescuePath.IsDirectory() && !CreateDirectoryW(baseRescuePath.AsNative().c_str(), nullptr)) + path += timestampDir; + if(!path.IsDirectory()) { - errorMessage += "\n\nCould not create the following directory for saving debug information and modified files to:\n" - + mpt::ToCString(baseRescuePath.ToWide()); + if(!CreateDirectoryW(path.AsNative().c_str(), nullptr)) + { + valid = false; + } } } +}; - bool hasWrittenDebug = false; - // Create minidump... +class DebugReporter +{ +private: + bool stateFrozen; + const DumpMode mode; + const CrashOutputDirectory crashDirectory; + bool writtenMiniDump; + bool writtenTraceLog; + int rescuedFiles; +private: + static bool FreezeState(DumpMode mode); + bool GenerateDump(_EXCEPTION_POINTERS *pExceptionInfo); + bool GenerateTraceLog(); + int RescueFiles(); + bool HasWrittenDebug() const { return writtenMiniDump || writtenTraceLog; } +public: + DebugReporter(DumpMode mode, _EXCEPTION_POINTERS *pExceptionInfo); + void ReportError(CString errorMessage); +}; + + +DebugReporter::DebugReporter(DumpMode mode, _EXCEPTION_POINTERS *pExceptionInfo) +//------------------------------------------------------------------------------ + : stateFrozen(FreezeState(mode)) + , mode(mode) + , writtenMiniDump(false) + , writtenTraceLog(false) + , rescuedFiles(0) +{ + if(mode == DumpModeCrash || mode == DumpModeWarning) { - const mpt::PathString filename = baseRescuePath + MPT_PATHSTRING("crash.dmp"); - if(WriteMemoryDump(pExceptionInfo, filename.AsNative().c_str(), ExceptionHandler::fullMemDump)) - { - hasWrittenDebug = true; - } + writtenMiniDump = GenerateDump(pExceptionInfo); } - - // Create trace log... + if(mode == DumpModeCrash || mode == DumpModeWarning || mode == DumpModeDebug) { - const mpt::PathString filename = baseRescuePath + MPT_PATHSTRING("trace.log"); - if(mpt::log::Trace::Dump(filename)) - { - hasWrittenDebug = true; - } + writtenTraceLog = GenerateTraceLog(); } - - if(hasWrittenDebug) + if(mode == DumpModeCrash || mode == DumpModeWarning) { - errorMessage += "\n\nDebug information has been saved to\n" - + mpt::ToCString(baseRescuePath.ToWide()); + rescuedFiles = RescueFiles(); } +} - // Rescue modified files... + +bool DebugReporter::GenerateDump(_EXCEPTION_POINTERS *pExceptionInfo) +//------------------------------------------------------------------- +{ + return WriteMemoryDump(pExceptionInfo, (crashDirectory.path + MPT_PATHSTRING("crash.dmp")).AsNative().c_str(), ExceptionHandler::fullMemDump); +} + + +bool DebugReporter::GenerateTraceLog() +//------------------------------------ +{ + return mpt::log::Trace::Dump(crashDirectory.path + MPT_PATHSTRING("trace.log")); +} + + +// Rescue modified files... +int DebugReporter::RescueFiles() +//------------------------------ +{ int numFiles = 0; std::vector<CModDoc *> documents = theApp.GetOpenDocuments(); for(std::vector<CModDoc *>::iterator doc = documents.begin(); doc != documents.end(); doc++) @@ -93,11 +132,11 @@ if(numFiles == 0) { // Show the rescue directory in Explorer... - CTrackApp::OpenDirectory(baseRescuePath); + CTrackApp::OpenDirectory(crashDirectory.path); } mpt::PathString filename; - filename += baseRescuePath; + filename += crashDirectory.path; filename += mpt::PathString::FromWide(mpt::ToWString(++numFiles)); filename += MPT_PATHSTRING("_"); filename += mpt::PathString::FromCStringSilent(pModDoc->GetTitle()).SanitizeComponent(); @@ -113,60 +152,92 @@ } } } + return numFiles; +} - if(numFiles > 0) + +void DebugReporter::ReportError(CString errorMessage) +//--------------------------------------------------- +{ + + if(!crashDirectory.valid) { - errorMessage.AppendFormat("\n\n%d modified file%s been rescued, but it cannot be guaranteed that %s still intact.", numFiles, (numFiles == 1 ? " has" : "s have"), (numFiles == 1 ? "it is" : "they are")); + errorMessage += "\n\nCould not create the following directory for saving debug information and modified files to:\n" + + mpt::ToCString(crashDirectory.path.ToWide()); } - + + if(HasWrittenDebug()) + { + errorMessage += "\n\nDebug information has been saved to\n" + + mpt::ToCString(crashDirectory.path.ToWide()); + } + + if(rescuedFiles > 0) + { + errorMessage.AppendFormat("\n\n%d modified file%s been rescued, but it cannot be guaranteed that %s still intact.", rescuedFiles, (rescuedFiles == 1 ? " has" : "s have"), (rescuedFiles == 1 ? "it is" : "they are")); + } + errorMessage.AppendFormat("\n\nOpenMPT %s (%s)\n", MptVersion::GetVersionStringExtended().c_str(), MptVersion::GetVersionUrlString().c_str() ); - if(mode == DumpModeWarning) - { - Reporting::Error(errorMessage, "OpenMPT Warning", pMainFrame); - } else - { - Reporting::Error(errorMessage, "OpenMPT Crash", pMainFrame); - } + Reporting::Error(errorMessage, (mode == DumpModeWarning) ? "OpenMPT Warning" : "OpenMPT Crash", CMainFrame::GetMainFrame()); + } -// Try to close the audio device and rescue unsaved work if an unhandled exception occurs... -LONG ExceptionHandler::UnhandledExceptionFilter(_EXCEPTION_POINTERS *pExceptionInfo) -//---------------------------------------------------------------------------------- +// Freezes the state as much aspossible in order to avoid further confusion by +// other (possibly still running) threads +bool DebugReporter::FreezeState(DumpMode mode) +//-------------------------------------------- { - // seal the trace log as early as possible mpt::log::Trace::Seal(); - // Shut down audio device... - CMainFrame* pMainFrame = CMainFrame::GetMainFrame(); - if(pMainFrame) + if(mode == DumpModeCrash || mode == DumpModeWarning) { - try + // Shut down audio device... + if(ExceptionHandler::stopSoundDeviceOnCrash) { - if(pMainFrame->gpSoundDevice) + CMainFrame* pMainFrame = CMainFrame::GetMainFrame(); + if(pMainFrame) { - pMainFrame->gpSoundDevice->Close(); + try + { + if(pMainFrame->gpSoundDevice) + { + pMainFrame->gpSoundDevice->Close(); + } + if(pMainFrame->m_NotifyTimer) + { + pMainFrame->KillTimer(pMainFrame->m_NotifyTimer); + pMainFrame->m_NotifyTimer = 0; + } + } catch(...) + { + } } - if(pMainFrame->m_NotifyTimer) - { - pMainFrame->KillTimer(pMainFrame->m_NotifyTimer); - pMainFrame->m_NotifyTimer = 0; - } - } catch(...) - { } } + return true; +} + + + +// Different entry points for different situations in which we want to dump some information + + +LONG ExceptionHandler::UnhandledExceptionFilter(_EXCEPTION_POINTERS *pExceptionInfo) +//---------------------------------------------------------------------------------- +{ + DebugReporter report(DumpModeCrash, pExceptionInfo); + CString errorMessage; errorMessage.Format("Unhandled exception 0x%X at address %p occurred.", pExceptionInfo->ExceptionRecord->ExceptionCode, pExceptionInfo->ExceptionRecord->ExceptionAddress); + report.ReportError(errorMessage); - GenerateDump(errorMessage, pExceptionInfo); - // Let Windows handle the exception... return EXCEPTION_CONTINUE_SEARCH; } @@ -177,33 +248,35 @@ noinline void AssertHandler(const char *file, int line, const char *function, const char *expr, const char *msg) //-------------------------------------------------------------------------------------------------------------- { - // seal the trace log as early as possible - mpt::log::Trace::Seal(); - + DebugReporter report(msg ? DumpModeWarning : DumpModeCrash, nullptr); if(IsDebuggerPresent()) { - mpt::log::Trace::Dump(MPT_PATHSTRING("mptrack.trace.log")); OutputDebugString("ASSERT("); OutputDebugString(expr); OutputDebugString(") failed\n"); DebugBreak(); } else { + CString errorMessage; if(msg) { - CString errorMessage; errorMessage.Format("Internal state inconsistency detected at %s(%d). This is just a warning that could potentially lead to a crash later on: %s [%s].", file, line, msg, function); - GenerateDump(errorMessage, NULL, DumpModeWarning); } else { - CString errorMessage; errorMessage.Format("Internal error occured at %s(%d): ASSERT(%s) failed in [%s].", file, line, expr, function); - GenerateDump(errorMessage); } + report.ReportError(errorMessage); } } #endif MPT_ASSERT_HANDLER_NEEDED +void DebugTraceDump() +//------------------- +{ + DebugReporter report(DumpModeDebug, nullptr); +} + + OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/mptrack/ExceptionHandler.h =================================================================== --- trunk/OpenMPT/mptrack/ExceptionHandler.h 2014-12-29 23:18:18 UTC (rev 4683) +++ trunk/OpenMPT/mptrack/ExceptionHandler.h 2014-12-30 10:44:08 UTC (rev 4684) @@ -18,6 +18,7 @@ { public: static bool fullMemDump; + static bool stopSoundDeviceOnCrash; // Call this to activate unhandled exception filtering. static void Register() { ::SetUnhandledExceptionFilter(UnhandledExceptionFilter); }; @@ -28,4 +29,6 @@ }; +void DebugTraceDump(); + OPENMPT_NAMESPACE_END Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2014-12-29 23:18:18 UTC (rev 4683) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2014-12-30 10:44:08 UTC (rev 4684) @@ -1091,6 +1091,11 @@ ComponentManager::Release(); + if(TrackerSettings::Instance().DebugTraceAlwaysDump) + { + DebugTraceDump(); + } + delete m_pPluginCache; m_pPluginCache = nullptr; delete m_pComponentManagerSettings; Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-29 23:18:18 UTC (rev 4683) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-30 10:44:08 UTC (rev 4684) @@ -23,6 +23,7 @@ #include "../common/misc_util.h" #include "PatternClipboard.h" #include "../common/ComponentManager.h" +#include "ExceptionHandler.h" #include <algorithm> @@ -235,7 +236,14 @@ , bridgeAllPlugins(conf, "VST Plugins", "BridgeAllPlugins", false) , DebugTraceEnable(conf, "Debug", "TraceEnable", false) , DebugTraceSize(conf, "Debug", "TraceSize", 1000000) + , DebugTraceAlwaysDump(conf, "Debug", "TraceAlwaysDump", false) + , DebugStopSoundDeviceOnCrash(conf, "Debug", "StopSoundDeviceOnCrash", true) { + + // Debug + // Duplicate state for debug stffu in order to avoid calling into settings fremwork from crash conetxt. + ExceptionHandler::stopSoundDeviceOnCrash = DebugStopSoundDeviceOnCrash; + // Effects #ifndef NO_DSP m_DSPSettings.m_nXBassDepth = conf.Read<int32>("Effects", "XBassDepth", m_DSPSettings.m_nXBassDepth); Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-29 23:18:18 UTC (rev 4683) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-30 10:44:08 UTC (rev 4684) @@ -517,7 +517,10 @@ Setting<bool> DebugTraceEnable; Setting<uint32> DebugTraceSize; + Setting<bool> DebugTraceAlwaysDump; + Setting<bool> DebugStopSoundDeviceOnCrash; + public: TrackerSettings(SettingsContainer &conf); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-12-31 00:37:00
|
Revision: 4687 http://sourceforge.net/p/modplug/code/4687 Author: saga-games Date: 2014-12-31 00:36:43 +0000 (Wed, 31 Dec 2014) Log Message: ----------- [New] Can now change the font of the comment text through the Display options. [Imp] Pattern tab: Data entry shortcuts / scroll wheel do now take the default volume into consideration, i.e. when making a data entry in an empty volume column field and there is a note and instrument next to it, a volume command is inserted (http://forum.openmpt.org/index.php?topic=5411.0) [Mod] OpenMPT: Version is now 1.24.01.04 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/Ctrl_com.cpp trunk/OpenMPT/mptrack/Ctrl_com.h trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainfrm.h trunk/OpenMPT/mptrack/Moptions.cpp trunk/OpenMPT/mptrack/Moptions.h trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/PatternFont.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_pat.h trunk/OpenMPT/mptrack/WelcomeDialog.cpp trunk/OpenMPT/mptrack/mptrack.rc Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/common/versionNumber.h 2014-12-31 00:36:43 UTC (rev 4687) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 24 #define VER_MINOR 01 -#define VER_MINORMINOR 03 +#define VER_MINORMINOR 04 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.cpp 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/Ctrl_com.cpp 2014-12-31 00:36:43 UTC (rev 4687) @@ -42,7 +42,7 @@ //--------------------------------------------------------------------------------------------------------- { m_nLockCount = 0; - m_hFont = NULL; + charWidth = 0; } @@ -74,7 +74,6 @@ { CModControlDlg::OnInitDialog(); // Initialize comments - m_hFont = NULL; m_EditComments.SetMargins(4, 0); UpdateView(CommentHint().ModType()); m_EditComments.SetFocus(); @@ -99,9 +98,9 @@ rect.right = rcClient.right - rect.left; if ((rect.right > rect.left) && (rect.bottom > rect.top)) { - int cxmax = (TrackerSettings::Instance().m_dwPatternSetup & PATTERN_LARGECOMMENTS) ? 80*8 : 80*6; + int cxmax = 80 * charWidth; int cx = rect.Width(), cy = rect.Height(); - if (cx > cxmax) cx = cxmax; + if (cx > cxmax && cxmax != 0) cx = cxmax; if ((cx != cx0) || (cy != cy0)) m_EditComments.SetWindowPos(NULL, 0,0, cx, cy, SWP_NOMOVE|SWP_NOZORDER|SWP_DRAWFRAME); } } @@ -114,17 +113,24 @@ if (pHint == this || !commentHint.GetType()[HINT_MODCOMMENTS | HINT_MPTOPTIONS | HINT_MODTYPE]) return; if (m_nLockCount) return; m_nLockCount++; - HFONT newfont; - if (TrackerSettings::Instance().m_dwPatternSetup & PATTERN_LARGECOMMENTS) - newfont = CMainFrame::GetLargeFixedFont(); - else - newfont = CMainFrame::GetFixedFont(); - if (newfont != m_hFont) + + static FontSetting previousFont; + FontSetting font = TrackerSettings::Instance().commentsFont; + // Point size to pixels + int32_t fontSize = -MulDiv(font.size, ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 720); + charWidth = (-fontSize + 1) / 2; + if(previousFont != font) { - m_hFont = newfont; - m_EditComments.SendMessage(WM_SETFONT, (WPARAM)newfont); - RecalcLayout(); + previousFont = font; + CMainFrame::GetCommentsFont() = ::CreateFont(fontSize, charWidth, 0, 0, font.flags[FontSetting::Bold] ? FW_BOLD : FW_NORMAL, + font.flags[FontSetting::Italic] ? TRUE :FALSE, FALSE, FALSE, + DEFAULT_CHARSET, OUT_RASTER_PRECIS, + CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, + FIXED_PITCH | FF_MODERN, font.name.c_str()); } + m_EditComments.SendMessage(WM_SETFONT, (WPARAM)CMainFrame::GetCommentsFont()); + RecalcLayout(); + m_EditComments.SetRedraw(FALSE); m_EditComments.SetSel(0, -1, TRUE); m_EditComments.ReplaceSel(""); Modified: trunk/OpenMPT/mptrack/Ctrl_com.h =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.h 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/Ctrl_com.h 2014-12-31 00:36:43 UTC (rev 4687) @@ -18,7 +18,7 @@ //======================================== { protected: - HFONT m_hFont; + int charWidth; UINT m_nLockCount; public: Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-12-31 00:36:43 UTC (rev 4687) @@ -420,26 +420,8 @@ if(drawDefaultVolume) { // Displaying sample default volume if there is no volume command. - const CSoundFile *pSndFile = GetSoundFile(); - SAMPLEINDEX sample = mc.instr; - if(pSndFile->GetNumInstruments()) - { - if(mc.instr <= pSndFile->GetNumInstruments() && pSndFile->Instruments[mc.instr]) - { - sample = pSndFile->Instruments[mc.instr]->Keyboard[mc.note - NOTE_MIN]; - } else - { - sample = 0; - } - } volcmd = VOLCMD_VOLUME; - if(sample && sample <= pSndFile->GetNumSamples()) - { - vol = pSndFile->GetSample(sample).nVolume / 4; - } else - { - vol = 64; - } + vol = GetDefaultVolume(mc); } if(volcmd != VOLCMD_NONE) Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2014-12-31 00:36:43 UTC (rev 4687) @@ -123,7 +123,6 @@ HICON CMainFrame::m_hIcon = NULL; HFONT CMainFrame::m_hGUIFont = NULL; HFONT CMainFrame::m_hFixedFont = NULL; -HFONT CMainFrame::m_hLargeFixedFont = NULL; HPEN CMainFrame::penDarkGray = NULL; HPEN CMainFrame::penScratch = NULL; HPEN CMainFrame::penGray00 = NULL; @@ -298,16 +297,6 @@ m_SampleIcons.Create(IDB_SMPTOOLBAR, 20, 18, SAMPLEIMG_NUMIMAGES, 1, GetDC()); m_hGUIFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); - m_hFixedFont = ::CreateFont(12,5, 0,0, 300, - FALSE, FALSE, FALSE, - OEM_CHARSET, OUT_RASTER_PRECIS, - CLIP_DEFAULT_PRECIS, DRAFT_QUALITY, - FIXED_PITCH | FF_MODERN, ""); - m_hLargeFixedFont = ::CreateFont(18,8, 0,0, 400, - FALSE, FALSE, FALSE, - OEM_CHARSET, OUT_RASTER_PRECIS, - CLIP_DEFAULT_PRECIS, DRAFT_QUALITY, - FIXED_PITCH | FF_MODERN, ""); if (m_hGUIFont == NULL) m_hGUIFont = (HFONT)GetStockObject(ANSI_VAR_FONT); brushBlack = (HBRUSH)::GetStockObject(BLACK_BRUSH); brushWhite = (HBRUSH)::GetStockObject(WHITE_BRUSH); @@ -415,7 +404,6 @@ DeleteGDIObject(penEnvelope); DeleteGDIObject(penEnvelopeHighlight); DeleteGDIObject(m_hFixedFont); - DeleteGDIObject(m_hLargeFixedFont); DeleteGDIObject(penScratch); DeleteGDIObject(penGray00); DeleteGDIObject(penGray33); Modified: trunk/OpenMPT/mptrack/Mainfrm.h =================================================================== --- trunk/OpenMPT/mptrack/Mainfrm.h 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/Mainfrm.h 2014-12-31 00:36:43 UTC (rev 4687) @@ -81,6 +81,7 @@ CTRLMSG_PREVORDER, CTRLMSG_NEXTORDER, CTRLMSG_SETRECORD, + CTRLMSG_PAT_DUPPATTERN, // Sample-Specific CTRLMSG_SMP_PREVINSTRUMENT, CTRLMSG_SMP_NEXTINSTRUMENT, @@ -95,7 +96,6 @@ CTRLMSG_INS_NEWINSTRUMENT, CTRLMSG_INS_SONGDROP, CTRLMSG_INS_SAMPLEMAP, - CTRLMSG_PAT_DUPPATTERN, }; enum @@ -331,7 +331,7 @@ // GDI static HICON m_hIcon; - static HFONT m_hGUIFont, m_hFixedFont, m_hLargeFixedFont; + static HFONT m_hGUIFont, m_hFixedFont; static HBRUSH brushGray, brushBlack, brushWhite, brushText, brushHighLight, brushHighLightRed, brushWindow, brushYellow; // static CBrush *pbrushBlack, *pbrushWhite; static HPEN penBlack, penDarkGray, penLightGray, penWhite, penHalfDarkGray, penSample, penEnvelope, penEnvelopeHighlight, penSeparator, penScratch, penGray00, penGray33, penGray40, penGray55, penGray80, penGray99, penGraycc, penGrayff; @@ -428,8 +428,7 @@ static void UpdateColors(); static HICON GetModIcon() { return m_hIcon; } static HFONT GetGUIFont() { return m_hGUIFont; } - static HFONT GetFixedFont() { return m_hFixedFont; } - static HFONT GetLargeFixedFont() { return m_hLargeFixedFont; } + static HFONT &GetCommentsFont() { return m_hFixedFont; } static void UpdateAllViews(UpdateHint hint, CObject *pHint=NULL); static LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam); static CInputHandler *m_InputHandler; //rewbs.customKeys Modified: trunk/OpenMPT/mptrack/Moptions.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moptions.cpp 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/Moptions.cpp 2014-12-31 00:36:43 UTC (rev 4687) @@ -66,7 +66,8 @@ ON_COMMAND(IDC_BUTTON6, OnPresetFT2) ON_COMMAND(IDC_BUTTON7, OnPresetIT) ON_COMMAND(IDC_BUTTON8, OnPresetBuzz) - ON_COMMAND(IDC_BUTTON9, OnChooseFont) + ON_COMMAND(IDC_BUTTON9, OnChoosePatternFont) + ON_COMMAND(IDC_BUTTON10, OnChooseCommentFont) ON_COMMAND(IDC_LOAD_COLORSCHEME, OnLoadColorScheme) ON_COMMAND(IDC_SAVE_COLORSCHEME, OnSaveColorScheme) ON_COMMAND(IDC_CHECK1, OnSettingsChanged) @@ -94,10 +95,10 @@ } -static std::string FormatFontName(const std::string fontName, int32_t fontSize) -//----------------------------------------------------------------------------- +static std::string FormatFontName(const FontSetting &font) +//-------------------------------------------------------- { - return fontName + ", " + mpt::ToString(fontSize / 10); + return font.name + ", " + mpt::ToString(font.size / 10); } @@ -120,9 +121,7 @@ SetDlgItemInt(IDC_PRIMARYHILITE, TrackerSettings::Instance().m_nRowHighlightMeasures); SetDlgItemInt(IDC_SECONDARYHILITE, TrackerSettings::Instance().m_nRowHighlightBeats); - fontName = TrackerSettings::Instance().patternFont; - fontSize = TrackerSettings::Instance().patternFontSize; - fontFlags = TrackerSettings::Instance().patternFontFlags; + patternFont = TrackerSettings::Instance().patternFont; m_ComboFont.AddString("Built-in (small)"); m_ComboFont.AddString("Built-in (large)"); m_ComboFont.AddString("Built-in (small, x2)"); @@ -130,18 +129,21 @@ m_ComboFont.AddString("Built-in (small, x3)"); m_ComboFont.AddString("Built-in (large, x3)"); int sel = 0; - if(fontName == PATTERNFONT_SMALL) + if(patternFont.name == PATTERNFONT_SMALL) { - sel = fontSize * 2; - } else if(fontName == PATTERNFONT_LARGE) + sel = patternFont.size * 2; + } else if(patternFont.name == PATTERNFONT_LARGE) { - sel = fontSize * 2 + 1; + sel = patternFont.size * 2 + 1; } else { - m_ComboFont.AddString(FormatFontName(fontName, fontSize).c_str()); + m_ComboFont.AddString(FormatFontName(patternFont).c_str()); sel = 6; } m_ComboFont.SetCurSel(sel); + + commentFont = TrackerSettings::Instance().commentsFont; + SetDlgItemText(IDC_BUTTON10, FormatFontName(commentFont).c_str()); OnColorSelChanged(); return TRUE; @@ -174,8 +176,7 @@ if (IsDlgButtonChecked(IDC_CHECK4)) TrackerSettings::Instance().m_dwPatternSetup |= PATTERN_2NDHIGHLIGHT; TrackerSettings::Instance().rememberSongWindows = IsDlgButtonChecked(IDC_CHECK5) != BST_UNCHECKED; - std::string newName = fontName; - int32_t newSize = fontSize; + FontSetting newPatternFont = patternFont; const int fontSel = m_ComboFont.GetCurSel(); switch(fontSel) { @@ -183,21 +184,20 @@ case 2: case 4: default: - newName = PATTERNFONT_SMALL; - newSize = fontSel / 2; + newPatternFont.name = PATTERNFONT_SMALL; + newPatternFont.size = fontSel / 2; break; case 1: case 3: case 5: - newName = PATTERNFONT_LARGE; - newSize = fontSel / 2; + newPatternFont.name = PATTERNFONT_LARGE; + newPatternFont.size = fontSel / 2; break; case 6: break; } - TrackerSettings::Instance().patternFont = newName; - TrackerSettings::Instance().patternFontSize = newSize; - TrackerSettings::Instance().patternFontFlags = fontFlags; + TrackerSettings::Instance().patternFont = newPatternFont; + TrackerSettings::Instance().commentsFont = commentFont; TrackerSettings::Instance().m_nRowHighlightMeasures = GetDlgItemInt(IDC_PRIMARYHILITE); TrackerSettings::Instance().m_nRowHighlightBeats = GetDlgItemInt(IDC_SECONDARYHILITE); @@ -218,20 +218,20 @@ } -void COptionsColors::OnChooseFont() -//--------------------------------- +void COptionsColors::OnChoosePatternFont() +//---------------------------------------- { LOGFONT lf; MemsetZero(lf); - const int32_t size = fontSize < 10 ? 120 : fontSize; + const int32_t size = patternFont.size < 10 ? 120 : patternFont.size; // Point size to pixels lf.lfHeight = -MulDiv(size, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 720); - lf.lfWeight = (fontFlags & PatternFontBold) ? FW_BOLD : FW_NORMAL; - lf.lfItalic = (fontFlags & PatternFontItalic) ? TRUE : FALSE; - mpt::String::Copy(lf.lfFaceName, fontName); + lf.lfWeight = patternFont.flags[FontSetting::Bold] ? FW_BOLD : FW_NORMAL; + lf.lfItalic = patternFont.flags[FontSetting::Italic] ? TRUE : FALSE; + mpt::String::Copy(lf.lfFaceName, patternFont.name); CFontDialog dlg(&lf); dlg.m_cf.hwndOwner = m_hWnd; - if(fontName != PATTERNFONT_SMALL && fontName != PATTERNFONT_LARGE) + if(patternFont.name != PATTERNFONT_SMALL && patternFont.name != PATTERNFONT_LARGE) { dlg.m_cf.lpLogFont = &lf; } @@ -243,18 +243,46 @@ { m_ComboFont.DeleteString(6); } - fontName = dlg.GetFaceName(); - fontSize = dlg.GetSize(); - fontFlags = 0; - if(dlg.IsBold()) fontFlags |= PatternFontBold; - if(dlg.IsItalic()) fontFlags |= PatternFontItalic; - m_ComboFont.AddString(FormatFontName(fontName, fontSize).c_str()); + patternFont.name = dlg.GetFaceName(); + patternFont.size = dlg.GetSize(); + patternFont.flags = FontSetting::None; + if(dlg.IsBold()) patternFont.flags |= FontSetting::Bold; + if(dlg.IsItalic()) patternFont.flags |= FontSetting::Italic; + m_ComboFont.AddString(FormatFontName(patternFont).c_str()); m_ComboFont.SetCurSel(6); OnSettingsChanged(); } } +void COptionsColors::OnChooseCommentFont() +//---------------------------------------- +{ + LOGFONT lf; + MemsetZero(lf); + // Point size to pixels + lf.lfHeight = -MulDiv(commentFont.size, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 720); + lf.lfWeight = commentFont.flags[FontSetting::Bold] ? FW_BOLD : FW_NORMAL; + lf.lfItalic = commentFont.flags[FontSetting::Italic] ? TRUE : FALSE; + mpt::String::Copy(lf.lfFaceName, commentFont.name); + CFontDialog dlg(&lf); + dlg.m_cf.hwndOwner = m_hWnd; + dlg.m_cf.lpLogFont = &lf; + dlg.m_cf.Flags &= ~CF_EFFECTS; + dlg.m_cf.Flags |= CF_FORCEFONTEXIST | CF_NOSCRIPTSEL; + if(dlg.DoModal() == IDOK) + { + commentFont.name = dlg.GetFaceName(); + commentFont.size = dlg.GetSize(); + commentFont.flags = FontSetting::None; + if(dlg.IsBold()) commentFont.flags |= FontSetting::Bold; + if(dlg.IsItalic()) commentFont.flags |= FontSetting::Italic; + SetDlgItemText(IDC_BUTTON10, FormatFontName(commentFont).c_str()); + OnSettingsChanged(); + } +} + + void COptionsColors::OnDrawItem(int nIdCtl, LPDRAWITEMSTRUCT lpdis) //----------------------------------------------------------------- { @@ -673,7 +701,6 @@ {PATTERN_PLAYNEWNOTE, "Play new notes while recording", "When this option is enabled, notes entered in the pattern editor will always be played (If not checked, notes won't be played in record mode)."}, {PATTERN_PLAYEDITROW, "Play whole row while recording", "When this option is enabled, all notes on the current row are played when entering notes in the pattern editor."}, {PATTERN_CENTERROW, "Always center active row", "Turn on this option to have the active row always centered in the pattern editor."}, - {PATTERN_LARGECOMMENTS, "Use large font for comments", "With this option enabled, the song message editor will use a larger font."}, {PATTERN_HEXDISPLAY, "Display rows in hex", "With this option enabled, row numbers and sequence numbers will be displayed in hexadecimal."}, {PATTERN_WRAP, "Cursor wrap in pattern editor", "When this option is active, going past the end of a pattern row or channel will move the cursor to the beginning. When \"Continuous scroll\"-option is enabled, row wrap is disabled."}, {PATTERN_CREATEBACKUP, "Create backup files (*.bak)", "When this option is active, saving a file will create a backup copy of the original."}, Modified: trunk/OpenMPT/mptrack/Moptions.h =================================================================== --- trunk/OpenMPT/mptrack/Moptions.h 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/Moptions.h 2014-12-31 00:36:43 UTC (rev 4687) @@ -86,8 +86,7 @@ CButton m_BtnColor1, m_BtnColor2, m_BtnColor3, m_BtnPreview; CStatic m_TxtColor1, m_TxtColor2, m_TxtColor3; MODPLUGDIB *m_pPreviewDib; - std::string fontName; - int32_t fontSize, fontFlags; + FontSetting patternFont, commentFont; public: COptionsColors():CPropertyPage(IDD_OPTIONS_COLORS) { m_nColorItem = 0; m_pPreviewDib = NULL; } @@ -100,7 +99,8 @@ virtual void OnOK(); virtual void DoDataExchange(CDataExchange* pDX); virtual BOOL OnSetActive(); - afx_msg void OnChooseFont(); + afx_msg void OnChoosePatternFont(); + afx_msg void OnChooseCommentFont(); afx_msg void OnUpdateDialog(); afx_msg void OnDrawItem(int nIdCtl, LPDRAWITEMSTRUCT lpdis); afx_msg void OnColorSelChanged(); Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2014-12-31 00:36:43 UTC (rev 4687) @@ -1051,7 +1051,9 @@ if(firstRun) { // On high-DPI devices, automatically upscale pattern font - TrackerSettings::Instance().patternFontSize = Clamp(::GetDeviceCaps(m_pMainWnd->GetDC()->m_hDC, LOGPIXELSX) / 96 - 1, 0, 9); + FontSetting font = TrackerSettings::Instance().patternFont; + font.size = Clamp(::GetDeviceCaps(m_pMainWnd->GetDC()->m_hDC, LOGPIXELSX) / 96 - 1, 0, 9); + TrackerSettings::Instance().patternFont = font; new WelcomeDlg(m_pMainWnd); } Modified: trunk/OpenMPT/mptrack/PatternFont.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternFont.cpp 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/PatternFont.cpp 2014-12-31 00:36:43 UTC (rev 4687) @@ -110,19 +110,17 @@ void PatternFont::UpdateFont(CDC *dc) //----------------------------------- { - const std::string name = TrackerSettings::Instance().patternFont; - int32_t fontSize = TrackerSettings::Instance().patternFontSize; - int32_t flags = TrackerSettings::Instance().patternFontFlags; + FontSetting font = TrackerSettings::Instance().patternFont; const PATTERNFONT *builtinFont = nullptr; - if(name == PATTERNFONT_SMALL || name.empty()) + if(font.name == PATTERNFONT_SMALL || font.name.empty()) { builtinFont = &gSmallPatternFont; - } else if(name == PATTERNFONT_LARGE) + } else if(font.name == PATTERNFONT_LARGE) { builtinFont = &gDefaultPatternFont; } - if(builtinFont != nullptr && fontSize < 1) + if(builtinFont != nullptr && font.size < 1) { currentFont = builtinFont; return; @@ -131,16 +129,13 @@ static PATTERNFONT pf = { 0 }; currentFont = &pf; - static std::string previousFont; - static int32_t previousSize, previousFlags; - if(previousFont == name && previousSize == fontSize && previousFlags == flags) + static FontSetting previousFont; + if(previousFont == font) { // Nothing to do return; } - previousFont = name; - previousSize = fontSize; - previousFlags = flags; + previousFont = font; DeleteFontData(); pf.dib = &customFontBitmap; @@ -148,18 +143,18 @@ if(builtinFont != nullptr) { // Copy and scale original 4-bit bitmap - LimitMax(fontSize, 10); - fontSize++; + LimitMax(font.size, 10); + font.size++; MemCopy(customFontBitmap.bmiHeader, CMainFrame::bmpNotes->bmiHeader); - customFontBitmap.bmiHeader.biWidth *= fontSize; - customFontBitmap.bmiHeader.biHeight *= fontSize; + customFontBitmap.bmiHeader.biWidth *= font.size; + customFontBitmap.bmiHeader.biHeight *= font.size; customFontBitmap.bmiHeader.biSizeImage = customFontBitmap.bmiHeader.biWidth * customFontBitmap.bmiHeader.biHeight / 2; customFontBitmap.lpDibBits = new uint8_t[customFontBitmap.bmiHeader.biSizeImage]; // Upscale the image (ugly code ahead) const uint8_t *origPixels = CMainFrame::bmpNotes->lpDibBits; uint8_t *scaledPixels = customFontBitmap.lpDibBits; - const int bytesPerLine = customFontBitmap.bmiHeader.biWidth / 2, scaleBytes = bytesPerLine * fontSize; + const int bytesPerLine = customFontBitmap.bmiHeader.biWidth / 2, scaleBytes = bytesPerLine * font.size; bool outPos = false; for(int y = 0; y < CMainFrame::bmpNotes->bmiHeader.biHeight; y++, scaledPixels += scaleBytes - bytesPerLine) { @@ -174,7 +169,7 @@ pixel &= 0x0F; origPixels++; } - for(int scaleX = 0; scaleX < fontSize; scaleX++) + for(int scaleX = 0; scaleX < font.size; scaleX++) { if(!outPos) { @@ -194,42 +189,42 @@ } } } - pf.nWidth = (builtinFont->nWidth - 4) * fontSize + 4; - pf.nHeight = builtinFont->nHeight * fontSize; - pf.nClrX = builtinFont->nClrX * fontSize; - pf.nClrY = builtinFont->nClrY * fontSize; - pf.nSpaceX = builtinFont->nSpaceX * fontSize; - pf.nSpaceY = builtinFont->nSpaceY * fontSize; + pf.nWidth = (builtinFont->nWidth - 4) * font.size + 4; + pf.nHeight = builtinFont->nHeight * font.size; + pf.nClrX = builtinFont->nClrX * font.size; + pf.nClrY = builtinFont->nClrY * font.size; + pf.nSpaceX = builtinFont->nSpaceX * font.size; + pf.nSpaceY = builtinFont->nSpaceY * font.size; for(size_t i = 0; i < CountOf(pf.nEltWidths); i++) { - pf.nEltWidths[i] = builtinFont->nEltWidths[i] * fontSize; - pf.padding[i] = builtinFont->padding[i] * fontSize; + pf.nEltWidths[i] = builtinFont->nEltWidths[i] * font.size; + pf.padding[i] = builtinFont->padding[i] * font.size; } - pf.nNumX = builtinFont->nNumX * fontSize; - pf.nNumY = builtinFont->nNumY * fontSize; - pf.nNum10X = builtinFont->nNum10X * fontSize; - pf.nNum10Y = builtinFont->nNum10Y * fontSize; - pf.nAlphaAM_X = builtinFont->nAlphaAM_X * fontSize; - pf.nAlphaAM_Y = builtinFont->nAlphaAM_Y * fontSize; - pf.nAlphaNZ_X = builtinFont->nAlphaNZ_X * fontSize; - pf.nAlphaNZ_Y = builtinFont->nAlphaNZ_Y * fontSize; - pf.nNoteX = builtinFont->nNoteX * fontSize; - pf.nNoteY = builtinFont->nNoteY * fontSize; - pf.nNoteWidth = builtinFont->nNoteWidth * fontSize; - pf.nOctaveWidth = builtinFont->nOctaveWidth * fontSize; - pf.nVolX = builtinFont->nVolX * fontSize; - pf.nVolY = builtinFont->nVolY * fontSize; - pf.nVolCmdWidth = builtinFont->nVolCmdWidth * fontSize; - pf.nVolHiWidth = builtinFont->nVolHiWidth * fontSize; - pf.nCmdOfs = builtinFont->nCmdOfs * fontSize; - pf.nParamHiWidth = builtinFont->nParamHiWidth * fontSize; - pf.nInstrOfs = builtinFont->nInstrOfs * fontSize; - pf.nInstr10Ofs = builtinFont->nInstr10Ofs * fontSize; - pf.nInstrHiWidth = builtinFont->nInstrHiWidth * fontSize; - pf.pcParamMargin = builtinFont->pcParamMargin * fontSize; - pf.pcValMargin = builtinFont->pcValMargin * fontSize; - pf.paramLoMargin = builtinFont->paramLoMargin * fontSize; - pf.spacingY = builtinFont->spacingY * fontSize; + pf.nNumX = builtinFont->nNumX * font.size; + pf.nNumY = builtinFont->nNumY * font.size; + pf.nNum10X = builtinFont->nNum10X * font.size; + pf.nNum10Y = builtinFont->nNum10Y * font.size; + pf.nAlphaAM_X = builtinFont->nAlphaAM_X * font.size; + pf.nAlphaAM_Y = builtinFont->nAlphaAM_Y * font.size; + pf.nAlphaNZ_X = builtinFont->nAlphaNZ_X * font.size; + pf.nAlphaNZ_Y = builtinFont->nAlphaNZ_Y * font.size; + pf.nNoteX = builtinFont->nNoteX * font.size; + pf.nNoteY = builtinFont->nNoteY * font.size; + pf.nNoteWidth = builtinFont->nNoteWidth * font.size; + pf.nOctaveWidth = builtinFont->nOctaveWidth * font.size; + pf.nVolX = builtinFont->nVolX * font.size; + pf.nVolY = builtinFont->nVolY * font.size; + pf.nVolCmdWidth = builtinFont->nVolCmdWidth * font.size; + pf.nVolHiWidth = builtinFont->nVolHiWidth * font.size; + pf.nCmdOfs = builtinFont->nCmdOfs * font.size; + pf.nParamHiWidth = builtinFont->nParamHiWidth * font.size; + pf.nInstrOfs = builtinFont->nInstrOfs * font.size; + pf.nInstr10Ofs = builtinFont->nInstr10Ofs * font.size; + pf.nInstrHiWidth = builtinFont->nInstrHiWidth * font.size; + pf.pcParamMargin = builtinFont->pcParamMargin * font.size; + pf.pcValMargin = builtinFont->pcValMargin * font.size; + pf.paramLoMargin = builtinFont->paramLoMargin * font.size; + pf.spacingY = builtinFont->spacingY * font.size; // Create 4-pixel border const int bmWidth2 = pf.dib->bmiHeader.biWidth / 2; @@ -244,14 +239,14 @@ // Create our own font! // Point size to pixels - fontSize = -MulDiv(fontSize, GetDeviceCaps(dc->m_hDC, LOGPIXELSY), 720); + font.size = -MulDiv(font.size, ::GetDeviceCaps(dc->m_hDC, LOGPIXELSY), 720); CDC hDC; hDC.CreateCompatibleDC(dc); - CFont font; - font.CreateFont(fontSize, 0, 0, 0, (flags & PatternFontBold) ? FW_BOLD : FW_NORMAL, (flags & PatternFontItalic) ? TRUE : FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_RASTER_PRECIS, CLIP_DEFAULT_PRECIS, NONANTIALIASED_QUALITY, FIXED_PITCH | FF_DONTCARE, name.c_str()); - CFont *oldFont = hDC.SelectObject(&font); + CFont gdiFont; + gdiFont.CreateFont(font.size, 0, 0, 0, font.flags[FontSetting::Bold] ? FW_BOLD : FW_NORMAL, font.flags[FontSetting::Italic] ? TRUE : FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_RASTER_PRECIS, CLIP_DEFAULT_PRECIS, NONANTIALIASED_QUALITY, FIXED_PITCH | FF_DONTCARE, font.name.c_str()); + CFont *oldFont = hDC.SelectObject(&gdiFont); CPoint pt = hDC.GetTextExtent(_T("W")); const int charWidth = pt.x, charHeight = pt.y; @@ -315,7 +310,7 @@ if(data == nullptr) { hDC.SelectObject(oldFont); - font.DeleteObject(); + gdiFont.DeleteObject(); hDC.DeleteDC(); currentFont = &gDefaultPatternFont; return; @@ -400,7 +395,7 @@ hDC.SelectObject(oldBitmap); hDC.SelectObject(oldFont); - font.DeleteObject(); + gdiFont.DeleteObject(); DeleteBitmap(bitmap); hDC.DeleteDC(); } Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-31 00:36:43 UTC (rev 4687) @@ -110,7 +110,7 @@ | PATTERN_FLATBUTTONS | PATTERN_NOEXTRALOUD | PATTERN_2NDHIGHLIGHT | PATTERN_STDHIGHLIGHT | PATTERN_SHOWPREVIOUS | PATTERN_CONTSCROLL | PATTERN_SYNCMUTE | PATTERN_AUTODELAY | PATTERN_NOTEFADE - | PATTERN_LARGECOMMENTS | PATTERN_SHOWDEFAULTVOLUME; + | PATTERN_SHOWDEFAULTVOLUME; } @@ -160,6 +160,7 @@ , GUIUpdateInterval(conf, "Display", "GUIUpdateInterval", 0) , VuMeterUpdateInterval(conf, "Display", "VuMeterUpdateInterval", 15) , rememberSongWindows(conf, "Display", "RememberSongWindows", true) + , commentsFont(conf, "Display", "Comments Font", FontSetting("Courier New", 120)) // Misc , ShowSettingsOnNewVersion(conf, "Misc", "ShowSettingsOnNewVersion", true) , gbShowHackControls(conf, "Misc", "ShowHackControls", false) @@ -210,9 +211,7 @@ , gnAutoChordWaitTime(conf, "Pattern Editor", "AutoChordWaitTime", 60) , orderlistMargins(conf, "Pattern Editor", "DefaultSequenceMargins", 0) , rowDisplayOffset(conf, "Pattern Editor", "RowDisplayOffset", 0) - , patternFont(conf, "Pattern Editor", "Font", PATTERNFONT_SMALL) - , patternFontSize(conf, "Pattern Editor", "Font Size", 0) - , patternFontFlags(conf, "Pattern Editor", "Font Flags", 0) + , patternFont(conf, "Pattern Editor", "Font", FontSetting(PATTERNFONT_SMALL, 0)) // Sample Editor , m_SampleUndoBufferSize(conf, "Sample Editor", "UndoBufferSize", SampleUndoBufferSize()) , sampleEditorKeyBehaviour(conf, "Sample Editor", "KeyBehaviour", seNoteOffOnNewKey) @@ -542,13 +541,17 @@ { m_dwPatternSetup &= ~0x10000000; // ditto } - if(storedVersion < MAKE_VERSION_NUMERIC(1,24,01,02)) + if(storedVersion < MAKE_VERSION_NUMERIC(1,24,01,04)) { + if(m_dwPatternSetup & 0x02) + patternFont = FontSetting("Courier New", 120); + else + patternFont = FontSetting("Courier New", 90); if(m_dwPatternSetup & 0x08) - patternFont = PATTERNFONT_SMALL; + patternFont = FontSetting(PATTERNFONT_SMALL, 0); else - patternFont = PATTERNFONT_LARGE; - m_dwPatternSetup &= ~0x08; + patternFont = FontSetting(PATTERNFONT_LARGE, 0); + m_dwPatternSetup &= ~(0x08 | 0x02); } // Effects Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-31 00:36:43 UTC (rev 4687) @@ -88,7 +88,7 @@ // Feel free to replace the deprecated flags by new flags, but be sure to // update TrackerSettings::TrackerSettings() as well. #define PATTERN_PLAYNEWNOTE 0x01 // play new notes while recording -#define PATTERN_LARGECOMMENTS 0x02 // use large font in comments +//#define PATTERN_LARGECOMMENTS 0x02 // use large font in comments #define PATTERN_STDHIGHLIGHT 0x04 // enable primary highlight (measures) //#define PATTERN_SMALLFONT 0x08 // use small font in pattern editor #define PATTERN_CENTERROW 0x10 // always center active row @@ -319,12 +319,6 @@ SoundDeviceStopModePlaying = 2, }; -enum FontFlags -{ - PatternFontBold = 1, - PatternFontItalic = 2, -}; - template<> inline SettingValue ToSettingValue(const SoundDeviceStopMode &val) { return SettingValue(static_cast<int32>(val)); @@ -334,7 +328,56 @@ return static_cast<SoundDeviceStopMode>(static_cast<int32>(val)); } +struct FontSetting +{ + enum FontFlags + { + None = 0, + Bold = 1, + Italic = 2, + }; + std::string name; + int32_t size; + FlagSet<FontFlags> flags; + + FontSetting(const std::string &name = "", int32_t size = 120, FontFlags flags = None) : name(name), size(size), flags(flags) { } + + bool operator== (const FontSetting &other) const + { + return name == other.name && size == other.size && flags == other.flags; + } + + bool operator!= (const FontSetting &other) const + { + return !(*this == other); + } +}; + +MPT_DECLARE_ENUM(FontSetting::FontFlags) + +template<> inline SettingValue ToSettingValue(const FontSetting &val) +{ + return SettingValue(val.name + "," + mpt::ToString(val.size) + "|" + mpt::ToString(val.flags.GetRaw())); +} +template<> inline FontSetting FromSettingValue(const SettingValue &val) +{ + FontSetting setting(val.as<std::string>()); + size_t sizeStart = setting.name.rfind(','); + if(sizeStart != std::string::npos) + { + setting.size = atoi(&setting.name[sizeStart + 1]); + size_t flagsStart = setting.name.find(' ', sizeStart + 1); + if(flagsStart != std::string::npos) + { + setting.flags = static_cast<FontSetting::FontFlags>(atoi(&setting.name[flagsStart + 1])); + } + setting.name.resize(sizeStart); + } + + return setting; +} + //=================== class TrackerSettings //=================== @@ -376,6 +419,9 @@ Setting<bool> rememberSongWindows; + Setting<FontSetting> commentsFont; + + // Misc Setting<bool> ShowSettingsOnNewVersion; @@ -451,9 +497,7 @@ CachedSetting<UINT> gnAutoChordWaitTime; CachedSetting<int32> orderlistMargins; CachedSetting<int32> rowDisplayOffset; - Setting<std::string> patternFont; - Setting<int32_t> patternFontSize; - Setting<int32_t> patternFontFlags; + Setting<FontSetting> patternFont; // Sample Editor Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2014-12-31 00:36:43 UTC (rev 4687) @@ -3024,6 +3024,11 @@ } else { int vol = m[chn].vol + offset * (coarse ? 10 : 1); + if(m[chn].volcmd == VOLCMD_NONE && m[chn].IsNote() && m[chn].instr) + { + m[chn].volcmd = VOLCMD_VOLUME; + vol = GetDefaultVolume(m[chn]); + } ModCommand::VOL minValue = 0, maxValue = 64; effectInfo.GetVolCmdInfo(effectInfo.GetIndexFromVolCmd(m[chn].volcmd), nullptr, &minValue, &maxValue); Limit(vol, (int)minValue, (int)maxValue); @@ -3056,6 +3061,32 @@ } +// Get the velocity at which a given note would be played +int CViewPattern::GetDefaultVolume(const ModCommand &m) const +//----------------------------------------------------------- +{ + const CSoundFile *pSndFile = GetSoundFile(); + SAMPLEINDEX sample = m.instr; + if(pSndFile->GetNumInstruments()) + { + if(m.instr <= pSndFile->GetNumInstruments() && pSndFile->Instruments[m.instr]) + { + sample = pSndFile->Instruments[m.instr]->Keyboard[m.note - NOTE_MIN]; + } else + { + sample = 0; + } + } + if(sample && sample <= pSndFile->GetNumSamples()) + { + return pSndFile->GetSample(sample).nVolume / 4; + } else + { + return 64; + } +} + + void CViewPattern::OnDropSelection() //---------------------------------- { Modified: trunk/OpenMPT/mptrack/View_pat.h =================================================================== --- trunk/OpenMPT/mptrack/View_pat.h 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/View_pat.h 2014-12-31 00:36:43 UTC (rev 4687) @@ -20,7 +20,6 @@ class CEditCommand; class CEffectVis; //rewbs.fxvis class CPatternGotoDialog; -struct PATTERNFONT; // Drag & Drop info #define DRAGITEM_VALUEMASK 0x00FFFFFF @@ -316,6 +315,8 @@ void TempEnterFXparam(int v); void EnterAftertouch(int note, int atValue); + int GetDefaultVolume(const ModCommand &m) const; + // Construct a chord from the chord presets. Returns number of notes in chord. int ConstructChord(int note, ModCommand::NOTE (&outNotes)[MPTChord::notesPerChord], ModCommand::NOTE baseNote); Modified: trunk/OpenMPT/mptrack/WelcomeDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/WelcomeDialog.cpp 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/WelcomeDialog.cpp 2014-12-31 00:36:43 UTC (rev 4687) @@ -120,7 +120,7 @@ combo->SetItemDataPtr(combo->AddString(_T("FastTracker 2")), "US_mpt-it2_classic"); CheckDlgButton(IDC_CHECK1, BST_CHECKED); - CheckDlgButton(IDC_CHECK2, (TrackerSettings::Instance().patternFont.Get() == PATTERNFONT_LARGE) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(IDC_CHECK2, (TrackerSettings::Instance().patternFont.Get().name == PATTERNFONT_LARGE) ? BST_CHECKED : BST_UNCHECKED); ShowWindow(SW_SHOW); @@ -151,7 +151,11 @@ bool runUpdates = IsDlgButtonChecked(IDC_CHECK1) != BST_UNCHECKED; CUpdateCheck::SetUpdateSettings(0, runUpdates ? 7 : 0, CUpdateCheck::GetUpdateURL(), CUpdateCheck::GetSendGUID(), CUpdateCheck::GetShowUpdateHint()); if(IsDlgButtonChecked(IDC_CHECK2) != BST_UNCHECKED) - TrackerSettings::Instance().patternFont = std::string(PATTERNFONT_LARGE); + { + FontSetting font = TrackerSettings::Instance().patternFont; + font.name = PATTERNFONT_LARGE; + TrackerSettings::Instance().patternFont = font; + } CComboBox *combo = (CComboBox *)GetDlgItem(IDC_COMBO1); const char *keyFile = static_cast<char *>(combo->GetItemDataPtr(combo->GetCurSel())); Modified: trunk/OpenMPT/mptrack/mptrack.rc =================================================================== --- trunk/OpenMPT/mptrack/mptrack.rc 2014-12-30 12:43:32 UTC (rev 4686) +++ trunk/OpenMPT/mptrack/mptrack.rc 2014-12-31 00:36:43 UTC (rev 4687) @@ -738,36 +738,38 @@ CAPTION "Display" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - GROUPBOX "",IDC_STATIC,6,6,276,114 + GROUPBOX "",IDC_STATIC,6,6,276,138 LTEXT "Pattern &Font:",IDC_STATIC,18,20,54,8 COMBOBOX IDC_COMBO2,72,18,144,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Custom...",IDC_BUTTON9,222,18,50,12 - CONTROL "&Enable effect highlighting",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,36,114,10 - CONTROL "&Primary highlight",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,54,84,10 - EDITTEXT IDC_PRIMARYHILITE,102,54,24,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Rows per measure (default)",IDC_STATIC,132,56,144,8 - CONTROL "&Secondary highlight",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,72,80,10 - EDITTEXT IDC_SECONDARYHILITE,102,72,24,12,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "Rows per beat (default)",IDC_STATIC,132,74,144,8 - LTEXT "Note: Songs' time signatures will override the default highlight values",IDC_STATIC,18,88,258,8 + LTEXT "Comments f&ont:",IDC_STATIC,18,38,52,8 + PUSHBUTTON "Font",IDC_BUTTON10,72,36,144,12 + CONTROL "&Enable effect highlighting",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,54,114,10 CONTROL "Remember each song's &window positions",IDC_CHECK5, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,102,258,10 - GROUPBOX "Colours",IDC_STATIC,6,126,276,150 - LTEXT "Select &colour for:",IDC_STATIC,18,146,63,8 - COMBOBOX IDC_COMBO1,90,144,114,109,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "",IDC_BUTTON4,"Button",BS_OWNERDRAW | BS_FLAT,89,162,114,43 - LTEXT "Background:",IDC_TEXT1,49,215,60,8 - CONTROL "Colour &1",IDC_BUTTON1,"Button",BS_OWNERDRAW,49,226,51,15 - LTEXT "Foreground:",IDC_TEXT2,122,215,62,8 - CONTROL "Colour &2",IDC_BUTTON2,"Button",BS_OWNERDRAW,122,226,51,15 - LTEXT "Highlight:",IDC_TEXT3,193,215,61,8 - CONTROL "Colour &3",IDC_BUTTON3,"Button",BS_OWNERDRAW,192,226,51,15 - PUSHBUTTON "&Load...",IDC_LOAD_COLORSCHEME,18,252,42,15 - PUSHBUTTON "S&ave...",IDC_SAVE_COLORSCHEME,66,252,42,15 - PUSHBUTTON "&MPT",IDC_BUTTON5,132,252,30,15 - PUSHBUTTON "&Green",IDC_BUTTON7,168,252,30,15 - PUSHBUTTON "&Blue",IDC_BUTTON6,204,252,30,15 - PUSHBUTTON "Bu&zz",IDC_BUTTON8,240,252,30,15 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,72,258,10 + CONTROL "&Primary highlight",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,90,84,10 + EDITTEXT IDC_PRIMARYHILITE,102,90,24,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Rows per measure (default)",IDC_STATIC,132,92,144,8 + CONTROL "&Secondary highlight",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,108,80,10 + EDITTEXT IDC_SECONDARYHILITE,102,108,24,12,ES_AUTOHSCROLL | ES_NUMBER + LTEXT "Rows per beat (default)",IDC_STATIC,132,110,144,8 + LTEXT "Note: Songs' time signatures will override the default highlight values",IDC_STATIC,18,124,258,8 + GROUPBOX "Colours",IDC_STATIC,6,150,276,108 + LTEXT "Select &colour for:",IDC_STATIC,18,164,63,8 + COMBOBOX IDC_COMBO1,90,162,114,109,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "",IDC_BUTTON4,"Button",BS_OWNERDRAW | BS_FLAT,18,180,114,43 + LTEXT "C1",IDC_TEXT1,138,183,60,8 + CONTROL "Change &1",IDC_BUTTON1,"Button",BS_OWNERDRAW,204,180,51,12 + LTEXT "C2",IDC_TEXT2,138,198,62,8 + CONTROL "Change &2",IDC_BUTTON2,"Button",BS_OWNERDRAW,204,196,51,12 + LTEXT "C3",IDC_TEXT3,138,212,61,8 + CONTROL "Change &3",IDC_BUTTON3,"Button",BS_OWNERDRAW,204,210,51,12 + PUSHBUTTON "&Load...",IDC_LOAD_COLORSCHEME,18,234,42,15 + PUSHBUTTON "S&ave...",IDC_SAVE_COLORSCHEME,66,234,42,15 + PUSHBUTTON "&MPT",IDC_BUTTON5,132,234,30,15 + PUSHBUTTON "&Green",IDC_BUTTON7,168,234,30,15 + PUSHBUTTON "&Blue",IDC_BUTTON6,204,234,30,15 + PUSHBUTTON "Bu&zz",IDC_BUTTON8,240,234,30,15 END IDD_OPTIONS_MIDI DIALOGEX 0, 0, 286, 269 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2014-12-31 11:35:56
|
Revision: 4691 http://sourceforge.net/p/modplug/code/4691 Author: manxorist Date: 2014-12-31 11:35:42 +0000 (Wed, 31 Dec 2014) Log Message: ----------- [Imp] sounddev: Allow disabling individual sound device types via hidden settings [Sound Settings]EnableFOO=0 . Modified Paths: -------------- trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/TrackerSettings.cpp trunk/OpenMPT/mptrack/TrackerSettings.h trunk/OpenMPT/sounddev/SoundDevice.cpp trunk/OpenMPT/sounddev/SoundDevice.h Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-12-31 02:28:44 UTC (rev 4690) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2014-12-31 11:35:42 UTC (rev 4691) @@ -200,7 +200,7 @@ delete CMainFrame::GetMainFrame()->gpSoundDevice; CMainFrame::GetMainFrame()->gpSoundDevice = nullptr; } - theApp.GetSoundDevicesManager()->ReEnumerate(); + theApp.GetSoundDevicesManager()->ReEnumerate(TrackerSettings::Instance().GetEnabledSoundDeviceTypes()); SetDevice(m_CurrentDeviceInfo.GetIdentifier(), true); UpdateEverything(); } Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2014-12-31 02:28:44 UTC (rev 4690) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2014-12-31 11:35:42 UTC (rev 4691) @@ -997,7 +997,7 @@ m_pMainWnd->DragAcceptFiles(); // Load sound APIs - m_pSoundDevicesManager = new SoundDevice::Manager(); + m_pSoundDevicesManager = new SoundDevice::Manager(TrackerSettings::Instance().GetEnabledSoundDeviceTypes()); if(TrackerSettings::Instance().m_SoundDeviceSettingsUseOldDefaults) { // get the old default device Modified: trunk/OpenMPT/mptrack/TrackerSettings.cpp =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-31 02:28:44 UTC (rev 4690) +++ trunk/OpenMPT/mptrack/TrackerSettings.cpp 2014-12-31 11:35:42 UTC (rev 4691) @@ -725,6 +725,19 @@ } +SoundDevice::TypesSet TrackerSettings::GetEnabledSoundDeviceTypes() const +//----------------------------------------------------------------------- +{ + SoundDevice::TypesSet result; + for(int i = 0; i < SoundDevice::TypeNUM_DEVTYPES; ++i) + { + SoundDevice::Type type = static_cast<SoundDevice::Type>(i); + result[i] = conf.Read<bool>(MPT_USTRING("Sound Settings"), MPT_USTRING("Enable") + SoundDevice::TypeToString(type, true), true); + } + return result; +} + + MixerSettings TrackerSettings::GetMixerSettings() const //----------------------------------------------------- { Modified: trunk/OpenMPT/mptrack/TrackerSettings.h =================================================================== --- trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-31 02:28:44 UTC (rev 4690) +++ trunk/OpenMPT/mptrack/TrackerSettings.h 2014-12-31 11:35:42 UTC (rev 4691) @@ -451,6 +451,8 @@ SoundDevice::Settings GetSoundDeviceSettings(const SoundDevice::Identifier &device) const; void SetSoundDeviceSettings(const SoundDevice::Identifier &device, const SoundDevice::Settings &settings); + SoundDevice::TypesSet GetEnabledSoundDeviceTypes() const; + Setting<uint32> MixerMaxChannels; Setting<uint32> MixerDSPMask; Setting<uint32> MixerFlags; Modified: trunk/OpenMPT/sounddev/SoundDevice.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.cpp 2014-12-31 02:28:44 UTC (rev 4690) +++ trunk/OpenMPT/sounddev/SoundDevice.cpp 2014-12-31 11:35:42 UTC (rev 4691) @@ -33,19 +33,19 @@ namespace SoundDevice { -mpt::ustring TypeToString(SoundDevice::Type type) -//----------------------------------------------- +mpt::ustring TypeToString(SoundDevice::Type type, bool verbose) +//------------------------------------------------------------- { switch(type) { case TypeWAVEOUT: return MPT_USTRING("WaveOut"); break; case TypeDSOUND: return MPT_USTRING("DirectSound"); break; case TypeASIO: return MPT_USTRING("ASIO"); break; - case TypePORTAUDIO_WASAPI: return MPT_USTRING("WASAPI"); break; - case TypePORTAUDIO_WDMKS: return MPT_USTRING("WDM-KS"); break; - case TypePORTAUDIO_WMME: return MPT_USTRING("MME"); break; - case TypePORTAUDIO_DS: return MPT_USTRING("DS"); break; - case TypePORTAUDIO_ASIO: return MPT_USTRING("ASIO"); break; + case TypePORTAUDIO_WASAPI: return (verbose ? MPT_USTRING("PortAudio") : MPT_USTRING("")) + MPT_USTRING("WASAPI"); break; + case TypePORTAUDIO_WDMKS: return (verbose ? MPT_USTRING("PortAudio") : MPT_USTRING("")) + MPT_USTRING("WDM-KS"); break; + case TypePORTAUDIO_WMME: return (verbose ? MPT_USTRING("PortAudio") : MPT_USTRING("")) + MPT_USTRING("MME"); break; + case TypePORTAUDIO_DS: return (verbose ? MPT_USTRING("PortAudio") : MPT_USTRING("")) + MPT_USTRING("DS"); break; + case TypePORTAUDIO_ASIO: return (verbose ? MPT_USTRING("PortAudio") : MPT_USTRING("")) + MPT_USTRING("ASIO"); break; } return mpt::ustring(); } @@ -466,8 +466,8 @@ // -void Manager::ReEnumerate() -//------------------------- +void Manager::ReEnumerate(SoundDevice::TypesSet enabledTypes) +//----------------------------------------------------------- { m_SoundDevices.clear(); m_DeviceUnavailable.clear(); @@ -481,23 +481,25 @@ } #endif // NO_PORTAUDIO + if(enabledTypes[SoundDevice::TypeWAVEOUT]) { const std::vector<SoundDevice::Info> infos = CWaveDevice::EnumerateDevices(); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); } #ifndef NO_ASIO + if(enabledTypes[SoundDevice::TypeASIO]) { const std::vector<SoundDevice::Info> infos = CASIODevice::EnumerateDevices(); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); } #endif // NO_ASIO #ifndef NO_PORTAUDIO - if(IsComponentAvailable(m_PortAudio)) + if(IsComponentAvailable(m_PortAudio) && enabledTypes[SoundDevice::TypePORTAUDIO_WASAPI]) { const std::vector<SoundDevice::Info> infos = CPortaudioDevice::EnumerateDevices(TypePORTAUDIO_WASAPI); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); } - if(IsComponentAvailable(m_PortAudio)) + if(IsComponentAvailable(m_PortAudio) && enabledTypes[SoundDevice::TypePORTAUDIO_WDMKS]) { const std::vector<SoundDevice::Info> infos = CPortaudioDevice::EnumerateDevices(TypePORTAUDIO_WDMKS); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); @@ -506,6 +508,7 @@ // kind of deprecated by now #ifndef NO_DSOUND + if(enabledTypes[SoundDevice::TypeDSOUND]) { const std::vector<SoundDevice::Info> infos = CDSoundDevice::EnumerateDevices(); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); @@ -514,17 +517,17 @@ // duplicate devices, only used if [Sound Settings]MorePortaudio=1 #ifndef NO_PORTAUDIO - if(IsComponentAvailable(m_PortAudio)) + if(IsComponentAvailable(m_PortAudio) && enabledTypes[SoundDevice::TypePORTAUDIO_WMME]) { const std::vector<SoundDevice::Info> infos = CPortaudioDevice::EnumerateDevices(TypePORTAUDIO_WMME); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); } - if(IsComponentAvailable(m_PortAudio)) + if(IsComponentAvailable(m_PortAudio) && enabledTypes[SoundDevice::TypePORTAUDIO_ASIO]) { const std::vector<SoundDevice::Info> infos = CPortaudioDevice::EnumerateDevices(TypePORTAUDIO_ASIO); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); } - if(IsComponentAvailable(m_PortAudio)) + if(IsComponentAvailable(m_PortAudio) && enabledTypes[SoundDevice::TypePORTAUDIO_DS]) { const std::vector<SoundDevice::Info> infos = CPortaudioDevice::EnumerateDevices(TypePORTAUDIO_DS); std::copy(infos.begin(), infos.end(), std::back_inserter(m_SoundDevices)); @@ -774,10 +777,10 @@ } -Manager::Manager() -//---------------- +Manager::Manager(SoundDevice::TypesSet enabledTypes) +//-------------------------------------------------- { - ReEnumerate(); + ReEnumerate(enabledTypes); } Modified: trunk/OpenMPT/sounddev/SoundDevice.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.h 2014-12-31 02:28:44 UTC (rev 4690) +++ trunk/OpenMPT/sounddev/SoundDevice.h 2014-12-31 11:35:42 UTC (rev 4691) @@ -17,6 +17,7 @@ #include "../common/ComponentManager.h" #include "../soundlib/SampleFormat.h" +#include <bitset> #include <map> #include <vector> @@ -95,9 +96,11 @@ TypePORTAUDIO_ASIO = 7, TypeNUM_DEVTYPES }; +typedef std::bitset<TypeNUM_DEVTYPES> TypesSet; -mpt::ustring TypeToString(SoundDevice::Type type); +mpt::ustring TypeToString(SoundDevice::Type type, bool verbose = false); + typedef uint8 Index; template<typename T> @@ -656,12 +659,12 @@ std::map<SoundDevice::Identifier, SoundDevice::DynamicCaps> m_DeviceDynamicCaps; public: - Manager(); + Manager(SoundDevice::TypesSet enabledTypes); ~Manager(); public: - void ReEnumerate(); + void ReEnumerate(SoundDevice::TypesSet enabledTypes); std::vector<SoundDevice::Info>::const_iterator begin() const { return m_SoundDevices.begin(); } std::vector<SoundDevice::Info>::const_iterator end() const { return m_SoundDevices.end(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-01-01 01:52:10
|
Revision: 4695 http://sourceforge.net/p/modplug/code/4695 Author: saga-games Date: 2015-01-01 01:52:01 +0000 (Thu, 01 Jan 2015) Log Message: ----------- [Fix] OpenMPT was leaking DC handles. Modified Paths: -------------- trunk/OpenMPT/mptrack/CListCtrl.h trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp trunk/OpenMPT/mptrack/Childfrm.cpp trunk/OpenMPT/mptrack/Ctrl_com.cpp trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/EffectVis.cpp trunk/OpenMPT/mptrack/Globals.cpp trunk/OpenMPT/mptrack/Globals.h trunk/OpenMPT/mptrack/MPTrackUtil.h trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/Mainbar.cpp trunk/OpenMPT/mptrack/Moptions.cpp trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/mptrack/PatternFont.cpp trunk/OpenMPT/mptrack/PatternFont.h trunk/OpenMPT/mptrack/SelectPluginDialog.cpp trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/mptrack/dlg_misc.cpp trunk/OpenMPT/mptrack/view_com.cpp trunk/OpenMPT/plugins/common/WindowBase.h Modified: trunk/OpenMPT/mptrack/CListCtrl.h =================================================================== --- trunk/OpenMPT/mptrack/CListCtrl.h 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/CListCtrl.h 2015-01-01 01:52:01 UTC (rev 4695) @@ -28,7 +28,7 @@ { for(int i = 0; i < numItems; i++) { - InsertColumn(i, header[i].text, header[i].mask, Util::ScalePixels(header[i].width, GetDC())); + InsertColumn(i, header[i].text, header[i].mask, Util::ScalePixels(header[i].width, m_hWnd)); } } Modified: trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp =================================================================== --- trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/ChannelManagerDlg.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -611,8 +611,8 @@ CRect wnd; GetClientRect(&wnd); - const int dpiX = ::GetDeviceCaps(::GetDC(m_hWnd), LOGPIXELSX); - const int dpiY = ::GetDeviceCaps(::GetDC(m_hWnd), LOGPIXELSY); + const int dpiX = Util::GetDPIx(m_hWnd); + const int dpiY = Util::GetDPIy(m_hWnd); // Move butttons to bottom of the window static const int buttons[] = { IDC_BUTTON1, IDC_BUTTON2, IDC_BUTTON3, IDC_BUTTON4, IDC_BUTTON5, IDC_BUTTON6 }; @@ -633,15 +633,17 @@ buttonHeight = MulDiv(CM_BT_HEIGHT, dpiY, 96); if(bkgnd) DeleteObject(bkgnd); - bkgnd = ::CreateCompatibleBitmap(::GetDC(m_hWnd), wnd.Width(), wnd.Height()); + HDC dc = ::GetDC(m_hWnd); + bkgnd = ::CreateCompatibleBitmap(dc, wnd.Width(), wnd.Height()); if(!moveRect && bkgnd) { - HDC bdc = ::CreateCompatibleDC(::GetDC(m_hWnd)); + HDC bdc = ::CreateCompatibleDC(dc); ::SelectObject(bdc,bkgnd); - ::BitBlt(bdc,0,0,wnd.Width(),wnd.Height(),::GetDC(m_hWnd),wnd.left,wnd.top,SRCCOPY); + ::BitBlt(bdc,0,0,wnd.Width(),wnd.Height(), dc,wnd.left,wnd.top,SRCCOPY); ::SelectObject(bdc,(HBITMAP)NULL); ::DeleteDC(bdc); } + ::ReleaseDC(m_hWnd, dc); nChannelsOld = 0; InvalidateRect(NULL, FALSE); @@ -682,8 +684,8 @@ PAINTSTRUCT pDC; ::BeginPaint(m_hWnd,&pDC); - const int dpiX = ::GetDeviceCaps(pDC.hdc, LOGPIXELSX); - const int dpiY = ::GetDeviceCaps(pDC.hdc, LOGPIXELSY); + const int dpiX = Util::GetDPIx(m_hWnd); + const int dpiY = Util::GetDPIy(m_hWnd); CHAR s[256]; UINT c=0,l=0; @@ -1130,14 +1132,16 @@ if(select[n] || button == 0) { invalidate = client = m_drawableArea; - if(!bkgnd) bkgnd = ::CreateCompatibleBitmap(::GetDC(m_hWnd),client.Width(),client.Height()); + HDC dc = ::GetDC(m_hWnd); + if(!bkgnd) bkgnd = ::CreateCompatibleBitmap(dc,client.Width(),client.Height()); if(!moveRect && bkgnd){ - HDC bdc = ::CreateCompatibleDC(::GetDC(m_hWnd)); + HDC bdc = ::CreateCompatibleDC(dc); ::SelectObject(bdc,bkgnd); - ::BitBlt(bdc,0,0,client.Width(),client.Height(),::GetDC(m_hWnd),client.left,client.top,SRCCOPY); + ::BitBlt(bdc,0,0,client.Width(),client.Height(), dc,client.left,client.top,SRCCOPY); ::SelectObject(bdc,(HBITMAP)NULL); ::DeleteDC(bdc); } + ::ReleaseDC(m_hWnd, dc); moveRect = true; } break; Modified: trunk/OpenMPT/mptrack/Childfrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/Childfrm.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/Childfrm.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -119,7 +119,7 @@ //------------------------------------------ { if (cy <= 1) cy = 188; //default to 188? why not.. - m_wndSplitter.SetRowInfo(0, Util::ScalePixels(cy, GetDC()), 15); + m_wndSplitter.SetRowInfo(0, Util::ScalePixels(cy, m_hWnd), 15); } @@ -248,7 +248,7 @@ if (pWnd) { pWnd->GetWindowRect(&rect); - int l = Util::ScalePixelsInv(rect.Height(), GetDC()); + int l = Util::ScalePixelsInv(rect.Height(), m_hWnd); //rewbs.varWindowSize - not the nicest piece of code, but we need to distinguish btw the views: if (strcmp(CViewGlobals::classCViewGlobals.m_lpszClassName, m_szCurrentViewClassName) == 0) TrackerSettings::Instance().glGeneralWindowHeight = l; @@ -277,7 +277,7 @@ if (pWnd) { pWnd->GetWindowRect(&rect); - return Util::ScalePixelsInv(rect.Height(), GetDC()); + return Util::ScalePixelsInv(rect.Height(), m_hWnd); } } return 15; // tidy default Modified: trunk/OpenMPT/mptrack/Ctrl_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_com.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/Ctrl_com.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -117,7 +117,7 @@ static FontSetting previousFont; FontSetting font = TrackerSettings::Instance().commentsFont; // Point size to pixels - int32_t fontSize = -MulDiv(font.size, ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 720); + int32_t fontSize = -MulDiv(font.size, m_nDPIy, 720); charWidth = (-fontSize + 1) / 2; if(previousFont != font) { Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -890,6 +890,7 @@ { CModControlDlg::OnInitDialog(); m_bInitialized = FALSE; + SetRedraw(FALSE); m_ToolBar.Init(CMainFrame::GetMainFrame()->m_PatternIcons,CMainFrame::GetMainFrame()->m_PatternIconsDisabled); m_ToolBar.AddButton(IDC_INSTRUMENT_NEW, TIMAGE_INSTR_NEW); @@ -970,6 +971,7 @@ CheckDlgButton(IDC_CHECK_PITCHTEMPOLOCK, MF_UNCHECKED); m_EditPitchTempoLock.SetLimitText(4); + SetRedraw(TRUE); return FALSE; } Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -125,6 +125,7 @@ CModControlDlg::OnInitDialog(); if(!pMainFrm) return TRUE; + SetRedraw(FALSE); LockControls(); // Order List m_BtnNext.GetWindowRect(&rect); @@ -206,6 +207,7 @@ m_bInitialized = TRUE; UnlockControls(); + SetRedraw(TRUE); return FALSE; } Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -199,6 +199,7 @@ { CModControlDlg::OnInitDialog(); m_bInitialized = FALSE; + SetRedraw(FALSE); // Zoom Selection m_ComboZoom.SetItemData(m_ComboZoom.AddString("Auto"), 0); @@ -315,6 +316,7 @@ // Stretch to size check box OnEnableStretchToSize(); + SetRedraw(TRUE); return TRUE; } Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -132,11 +132,9 @@ if (m_nDetailLevel >= PatternCursor::effectColumn) m_szCell.cx += pfnt->nEltWidths[3] + pfnt->nEltWidths[4]; m_szCell.cy = pfnt->nHeight; - const int dpiX = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSX); - const int dpiY = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY); - m_szHeader.cx = MulDiv(m_szHeader.cx, dpiX, 96); - m_szHeader.cy = MulDiv(m_szHeader.cy, dpiY, 96); - m_szPluginHeader.cy = MulDiv(m_szPluginHeader.cy, dpiY, 96); + m_szHeader.cx = MulDiv(m_szHeader.cx, m_nDPIx, 96); + m_szHeader.cy = MulDiv(m_szHeader.cy, m_nDPIy, 96); + m_szPluginHeader.cy = MulDiv(m_szPluginHeader.cy, m_nDPIy, 96); m_szHeader.cy += m_szPluginHeader.cy; if(oldy != m_szCell.cy) @@ -168,7 +166,7 @@ } if(hint.GetType()[HINT_MPTOPTIONS]) { - PatternFont::UpdateFont(GetDC()); + PatternFont::UpdateFont(m_hWnd); UpdateColors(); UpdateSizes(); UpdateScrollSize(); @@ -226,7 +224,7 @@ } if (pt.x < 0) pt.x = 0; - pt.x += Util::ScalePixels(ROWHDR_WIDTH, GetDC()); + pt.x += Util::ScalePixels(ROWHDR_WIDTH, m_hWnd); pt.y = (cursor.GetRow() - yofs + m_nMidRow) * m_szCell.cy; if (pt.y < 0) pt.y = 0; @@ -468,11 +466,9 @@ UpdateSizes(); if ((pModDoc = GetDocument()) == nullptr) return; - const int dpiX = ::GetDeviceCaps(pDC->m_hDC, LOGPIXELSX); - const int dpiY = ::GetDeviceCaps(pDC->m_hDC, LOGPIXELSY); - const int vuHeight = MulDiv(VUMETERS_HEIGHT, dpiY, 96); - const int colHeight = MulDiv(COLHDR_HEIGHT, dpiY, 96); - const int recordInsX = MulDiv(3, dpiY, 96); + const int vuHeight = MulDiv(VUMETERS_HEIGHT, m_nDPIy, 96); + const int colHeight = MulDiv(COLHDR_HEIGHT, m_nDPIy, 96); + const int recordInsX = MulDiv(3, m_nDPIy, 96); GetClientRect(&rcClient); hdc = pDC->m_hDC; @@ -1679,7 +1675,7 @@ const bool isPlaying = (pMainFrm->GetFollowSong(pModDoc) == m_hWnd); int x = m_szHeader.cx; CHANNELINDEX nChn = static_cast<CHANNELINDEX>(xofs); - const int yPos = rcClient.top + MulDiv(COLHDR_HEIGHT, ::GetDeviceCaps(hdc, LOGPIXELSY), 96); + const int yPos = rcClient.top + MulDiv(COLHDR_HEIGHT, m_nDPIy, 96); while ((nChn < pModDoc->GetNumChannels()) && (x < rcClient.right)) { ChnVUMeters[nChn] = (WORD)pnotify->pos[nChn]; Modified: trunk/OpenMPT/mptrack/EffectVis.cpp =================================================================== --- trunk/OpenMPT/mptrack/EffectVis.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/EffectVis.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -429,7 +429,7 @@ return; //Draw - const int lineWidth = Util::ScalePixels(1, GetDC()); + const int lineWidth = Util::ScalePixels(1, m_hWnd); const int nodeSizeHalf = m_nodeSizeHalf; const int nodeSizeHalf2 = nodeSizeHalf - lineWidth + 1; const int nodeSize = 2 * nodeSizeHalf + 1; @@ -753,7 +753,7 @@ { CDialog::OnInitDialog(); - int dpi = GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSX); + int dpi = Util::GetDPIx(m_hWnd); m_nodeSizeHalf = MulDiv(3, dpi, 96); m_marginBottom = MulDiv(20, dpi, 96); m_innerBorder = MulDiv(4, dpi, 96); Modified: trunk/OpenMPT/mptrack/Globals.cpp =================================================================== --- trunk/OpenMPT/mptrack/Globals.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/Globals.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -37,6 +37,11 @@ BEGIN_MESSAGE_MAP(CModControlDlg, CDialog) //{{AFX_MSG_MAP(CModControlDlg) ON_WM_SIZE() +#ifdef WM_DPICHANGED + ON_MESSAGE(WM_DPICHANGED, OnDPIChanged) +#else + ON_MESSAGE(0x02E0, OnDPIChanged) +#endif ON_MESSAGE(WM_MOD_UNLOCKCONTROLS, OnUnlockControls) ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipText) ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipText) @@ -64,11 +69,22 @@ //--------------------------------- { CDialog::OnInitDialog(); + m_nDPIx = Util::GetDPIx(m_hWnd); + m_nDPIy = Util::GetDPIy(m_hWnd); EnableToolTips(TRUE); return TRUE; } +LRESULT CModControlDlg::OnDPIChanged(WPARAM wParam, LPARAM) +//--------------------------------------------------------- +{ + m_nDPIx = LOWORD(wParam); + m_nDPIy = HIWORD(wParam); + return 0; +} + + void CModControlDlg::OnSize(UINT nType, int cx, int cy) //----------------------------------------------------- { @@ -227,6 +243,7 @@ void CModControlView::OnInitialUpdate() // called first time after construct //------------------------------------- { + CView::OnInitialUpdate(); CRect rect; CChildFrame *pParentFrame = (CChildFrame *)GetParentFrame(); @@ -545,6 +562,11 @@ //{{AFX_MSG_MAP(CModScrollView) ON_WM_DESTROY() ON_WM_MOUSEWHEEL() +#ifdef WM_DPICHANGED + ON_MESSAGE(WM_DPICHANGED, OnDPIChanged) +#else + ON_MESSAGE(0x02E0, OnDPIChanged) +#endif ON_MESSAGE(WM_MOD_VIEWMSG, OnReceiveModViewMsg) ON_MESSAGE(WM_MOD_DRAGONDROPPING, OnDragonDropping) ON_MESSAGE(WM_MOD_UPDATEPOSITION, OnUpdatePosition) @@ -601,6 +623,24 @@ } +void CModScrollView::OnInitialUpdate() +//------------------------------------ +{ + CScrollView::OnInitialUpdate(); + m_nDPIx = Util::GetDPIx(m_hWnd); + m_nDPIy = Util::GetDPIy(m_hWnd); +} + + +LRESULT CModScrollView::OnDPIChanged(WPARAM wParam, LPARAM) +//--------------------------------------------------------- +{ + m_nDPIx = LOWORD(wParam); + m_nDPIy = HIWORD(wParam); + return 0; +} + + void CModScrollView::UpdateIndicator(LPCSTR lpszText) //--------------------------------------------------- { Modified: trunk/OpenMPT/mptrack/Globals.h =================================================================== --- trunk/OpenMPT/mptrack/Globals.h 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/Globals.h 2015-01-01 01:52:01 UTC (rev 4695) @@ -48,6 +48,7 @@ CModControlView &m_parent; HWND m_hWndView; LONG m_nLockCount; + int m_nDPIx, m_nDPIy; // Cached DPI settings BOOL m_bInitialized; public: @@ -96,6 +97,7 @@ afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg LRESULT OnUnlockControls(WPARAM, LPARAM) { if (m_nLockCount > 0) m_nLockCount--; return 0; } afx_msg BOOL OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult); + afx_msg LRESULT OnDPIChanged(WPARAM = 0, LPARAM = 0); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; @@ -199,6 +201,7 @@ protected: HWND m_hWndCtrl; int m_nScrollPosX, m_nScrollPosY; + int m_nDPIx, m_nDPIy; // Cached DPI settings public: DECLARE_SERIAL(CModScrollView) @@ -213,6 +216,7 @@ public: //{{AFX_VIRTUAL(CModScrollView) + virtual void OnInitialUpdate(); virtual void OnDraw(CDC *) {} virtual void OnPrepareDC(CDC*, CPrintInfo*) {} virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint); @@ -230,7 +234,8 @@ afx_msg LRESULT OnReceiveModViewMsg(WPARAM wParam, LPARAM lParam); afx_msg BOOL OnMouseWheel(UINT fFlags, short zDelta, CPoint point); afx_msg LRESULT OnDragonDropping(WPARAM bDoDrop, LPARAM lParam) { return OnDragonDrop((BOOL)bDoDrop, (const DRAGONDROP *)lParam); } - LRESULT OnUpdatePosition(WPARAM, LPARAM); + afx_msg LRESULT OnUpdatePosition(WPARAM, LPARAM); + afx_msg LRESULT OnDPIChanged(WPARAM = 0, LPARAM = 0); // Fixes for 16-bit limitation in MFC's CScrollView virtual BOOL OnScroll(UINT nScrollCode, UINT nPos, BOOL bDoScroll = TRUE); Modified: trunk/OpenMPT/mptrack/MPTrackUtil.h =================================================================== --- trunk/OpenMPT/mptrack/MPTrackUtil.h 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/MPTrackUtil.h 2015-01-01 01:52:01 UTC (rev 4695) @@ -96,16 +96,34 @@ } } + // Get horizontal DPI resolution + forceinline int GetDPIx(HWND hwnd) + { + HDC dc = ::GetDC(hwnd); + int dpi = ::GetDeviceCaps(dc, LOGPIXELSX); + ::ReleaseDC(hwnd, dc); + return dpi; + } + + // Get vertical DPI resolution + forceinline int GetDPIy(HWND hwnd) + { + HDC dc = ::GetDC(hwnd); + int dpi = ::GetDeviceCaps(dc, LOGPIXELSY); + ::ReleaseDC(hwnd, dc); + return dpi; + } + // Applies DPI scaling factor to some given size - forceinline int ScalePixels(int pixels, CDC *pDC) + forceinline int ScalePixels(int pixels, HWND hwnd) { - return MulDiv(pixels, ::GetDeviceCaps(pDC->m_hDC, LOGPIXELSX), 96); + return MulDiv(pixels, GetDPIx(hwnd), 96); } // Removes DPI scaling factor from some given size - forceinline int ScalePixelsInv(int pixels, CDC *pDC) + forceinline int ScalePixelsInv(int pixels, HWND hwnd) { - return MulDiv(pixels, 96, ::GetDeviceCaps(pDC->m_hDC, LOGPIXELSX)); + return MulDiv(pixels, 96, GetDPIx(hwnd)); } } Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -289,12 +289,14 @@ m_hIcon = theApp.LoadIcon(IDR_MAINFRAME); // Toolbar and other icons - m_MiscIcons.Create(IDB_IMAGELIST, 16, 16, IMGLIST_NUMIMAGES, 1, GetDC()); - m_MiscIconsDisabled.Create(IDB_IMAGELIST, 16, 16, IMGLIST_NUMIMAGES, 1, GetDC(), true); - m_PatternIcons.Create(IDB_PATTERNS, 16, 16, PATTERNIMG_NUMIMAGES, 1, GetDC()); - m_PatternIconsDisabled.Create(IDB_PATTERNS, 16, 16, PATTERNIMG_NUMIMAGES, 1, GetDC(), true); - m_EnvelopeIcons.Create(IDB_ENVTOOLBAR, 20, 18, ENVIMG_NUMIMAGES, 1, GetDC()); - m_SampleIcons.Create(IDB_SMPTOOLBAR, 20, 18, SAMPLEIMG_NUMIMAGES, 1, GetDC()); + CDC *dc = GetDC(); + m_MiscIcons.Create(IDB_IMAGELIST, 16, 16, IMGLIST_NUMIMAGES, 1, dc); + m_MiscIconsDisabled.Create(IDB_IMAGELIST, 16, 16, IMGLIST_NUMIMAGES, 1, dc, true); + m_PatternIcons.Create(IDB_PATTERNS, 16, 16, PATTERNIMG_NUMIMAGES, 1, dc); + m_PatternIconsDisabled.Create(IDB_PATTERNS, 16, 16, PATTERNIMG_NUMIMAGES, 1, dc, true); + m_EnvelopeIcons.Create(IDB_ENVTOOLBAR, 20, 18, ENVIMG_NUMIMAGES, 1, dc); + m_SampleIcons.Create(IDB_SMPTOOLBAR, 20, 18, SAMPLEIMG_NUMIMAGES, 1, dc); + ReleaseDC(dc); m_hGUIFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); if (m_hGUIFont == NULL) m_hGUIFont = (HFONT)GetStockObject(ANSI_VAR_FONT); Modified: trunk/OpenMPT/mptrack/Mainbar.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mainbar.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/Mainbar.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -130,7 +130,7 @@ ///////////////////////////////////////////////////////////////////// // CMainToolBar -#define SCALEWIDTH(x) (Util::ScalePixels(x, GetDC())) +#define SCALEWIDTH(x) (Util::ScalePixels(x, m_hWnd)) // Play Command #define PLAYCMD_INDEX 10 @@ -237,8 +237,10 @@ if (!CToolBar::Create(parent, dwStyle)) return FALSE; - m_ImageList.Create(IDB_MAINBAR, 16, 16, IMGLIST_NUMIMAGES, 1, GetDC()); - m_ImageListDisabled.Create(IDB_MAINBAR, 16, 16, IMGLIST_NUMIMAGES, 1, GetDC(), true); + CDC *dc = GetDC(); + m_ImageList.Create(IDB_MAINBAR, 16, 16, IMGLIST_NUMIMAGES, 1, dc); + m_ImageListDisabled.Create(IDB_MAINBAR, 16, 16, IMGLIST_NUMIMAGES, 1, dc, true); + ReleaseDC(dc); GetToolBarCtrl().SetImageList(&m_ImageList); GetToolBarCtrl().SetDisabledImageList(&m_ImageListDisabled); @@ -640,7 +642,7 @@ m_pModTree = new CModTree(m_pModTreeData); if (m_pModTree) m_pModTree->SubclassDlgItem(IDC_TREEVIEW, this); m_dwStatus = 0; - m_sizeDefault.cx = Util::ScalePixels(TrackerSettings::Instance().glTreeWindowWidth, GetDC()) + 3; + m_sizeDefault.cx = Util::ScalePixels(TrackerSettings::Instance().glTreeWindowWidth, m_hWnd) + 3; m_sizeDefault.cy = 32767; return l; } @@ -718,7 +720,7 @@ CSize CModTreeBar::CalcFixedLayout(BOOL, BOOL) //-------------------------------------------- { - int width = Util::ScalePixels(TrackerSettings::Instance().glTreeWindowWidth, GetDC()); + int width = Util::ScalePixels(TrackerSettings::Instance().glTreeWindowWidth, m_hWnd); CSize sz; m_sizeDefault.cx = width; m_sizeDefault.cy = 32767; @@ -870,7 +872,7 @@ CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); if ((m_nTrackPos != (UINT)rect.Width()) && (pMainFrm)) { - TrackerSettings::Instance().glTreeWindowWidth = Util::ScalePixelsInv(m_nTrackPos - 3, GetDC()); + TrackerSettings::Instance().glTreeWindowWidth = Util::ScalePixelsInv(m_nTrackPos - 3, m_hWnd); m_sizeDefault.cx = m_nTrackPos; m_sizeDefault.cy = 32767; pMainFrm->RecalcLayout(); Modified: trunk/OpenMPT/mptrack/Moptions.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moptions.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/Moptions.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -225,7 +225,7 @@ MemsetZero(lf); const int32_t size = patternFont.size < 10 ? 120 : patternFont.size; // Point size to pixels - lf.lfHeight = -MulDiv(size, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 720); + lf.lfHeight = -MulDiv(size, Util::GetDPIy(m_hWnd), 720); lf.lfWeight = patternFont.flags[FontSetting::Bold] ? FW_BOLD : FW_NORMAL; lf.lfItalic = patternFont.flags[FontSetting::Italic] ? TRUE : FALSE; mpt::String::Copy(lf.lfFaceName, patternFont.name); @@ -261,7 +261,7 @@ LOGFONT lf; MemsetZero(lf); // Point size to pixels - lf.lfHeight = -MulDiv(commentFont.size, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 720); + lf.lfHeight = -MulDiv(commentFont.size, Util::GetDPIy(m_hWnd), 720); lf.lfWeight = commentFont.flags[FontSetting::Bold] ? FW_BOLD : FW_NORMAL; lf.lfItalic = commentFont.flags[FontSetting::Italic] ? TRUE : FALSE; mpt::String::Copy(lf.lfFaceName, commentFont.name); Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -1052,7 +1052,7 @@ { // On high-DPI devices, automatically upscale pattern font FontSetting font = TrackerSettings::Instance().patternFont; - font.size = Clamp(::GetDeviceCaps(m_pMainWnd->GetDC()->m_hDC, LOGPIXELSX) / 96 - 1, 0, 9); + font.size = Clamp(Util::GetDPIy(m_pMainWnd->m_hWnd) / 96 - 1, 0, 9); TrackerSettings::Instance().patternFont = font; new WelcomeDlg(m_pMainWnd); } @@ -1348,7 +1348,9 @@ BOOL CSplashScreen::OnInitDialog() //-------------------------------- { - bitmap->ToDIB(m_Bitmap, GetDC()); + CDC *dc = GetDC(); + bitmap->ToDIB(m_Bitmap, dc); + ReleaseDC(dc); CRect rect; int cx, cy, newcx, newcy; Modified: trunk/OpenMPT/mptrack/PatternFont.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternFont.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/PatternFont.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -107,8 +107,8 @@ } } -void PatternFont::UpdateFont(CDC *dc) -//----------------------------------- +void PatternFont::UpdateFont(HWND hwnd) +//------------------------------------- { FontSetting font = TrackerSettings::Instance().patternFont; const PATTERNFONT *builtinFont = nullptr; @@ -238,11 +238,11 @@ } // Create our own font! - // Point size to pixels - font.size = -MulDiv(font.size, ::GetDeviceCaps(dc->m_hDC, LOGPIXELSY), 720); CDC hDC; - hDC.CreateCompatibleDC(dc); + hDC.CreateCompatibleDC(CDC::FromHandle(::GetDC(hwnd))); + // Point size to pixels + font.size = -MulDiv(font.size, Util::GetDPIy(hwnd), 720); CFont gdiFont; gdiFont.CreateFont(font.size, 0, 0, 0, font.flags[FontSetting::Bold] ? FW_BOLD : FW_NORMAL, font.flags[FontSetting::Italic] ? TRUE : FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_RASTER_PRECIS, CLIP_DEFAULT_PRECIS, NONANTIALIASED_QUALITY, FIXED_PITCH | FF_DONTCARE, font.name.c_str()); Modified: trunk/OpenMPT/mptrack/PatternFont.h =================================================================== --- trunk/OpenMPT/mptrack/PatternFont.h 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/PatternFont.h 2015-01-01 01:52:01 UTC (rev 4695) @@ -46,7 +46,7 @@ public: static const PATTERNFONT *currentFont; - static void UpdateFont(CDC *dc); + static void UpdateFont(HWND hwnd); static void DeleteFontData(); }; Modified: trunk/OpenMPT/mptrack/SelectPluginDialog.cpp =================================================================== --- trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/SelectPluginDialog.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -105,8 +105,8 @@ ::EnableWindow(::GetDlgItem(m_hWnd, IDOK), FALSE); } - const int dpiX = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSX); - const int dpiY = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY); + const int dpiX = Util::GetDPIx(m_hWnd); + const int dpiY = Util::GetDPIy(m_hWnd); MoveWindow(MulDiv(TrackerSettings::Instance().gnPlugWindowX, dpiX, 96), MulDiv(TrackerSettings::Instance().gnPlugWindowY, dpiY, 96), MulDiv(TrackerSettings::Instance().gnPlugWindowWidth, dpiX, 96), @@ -223,8 +223,8 @@ { CRect rect; GetWindowRect(&rect); - const int dpiX = ::GetDeviceCaps(::GetDC(m_hWnd), LOGPIXELSX); - const int dpiY = ::GetDeviceCaps(::GetDC(m_hWnd), LOGPIXELSY); + const int dpiX = Util::GetDPIx(m_hWnd); + const int dpiY = Util::GetDPIy(m_hWnd); TrackerSettings::Instance().gnPlugWindowX = MulDiv(rect.left, 96, dpiX); TrackerSettings::Instance().gnPlugWindowY = MulDiv(rect.top, 96, dpiY); TrackerSettings::Instance().gnPlugWindowWidth = MulDiv(rect.Width(), 96, dpiY); @@ -728,8 +728,8 @@ { CDialog::OnSize(nType, cx, cy); - const int dpiX = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSX); - const int dpiY = ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY); + const int dpiX = Util::GetDPIx(m_hWnd); + const int dpiY = Util::GetDPIy(m_hWnd); if (m_treePlugins) { @@ -755,8 +755,8 @@ void CSelectPluginDlg::OnGetMinMaxInfo(MINMAXINFO* lpMMI) //------------------------------------------------------- { - lpMMI->ptMinTrackSize.x = MulDiv(350, ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSX), 96); - lpMMI->ptMinTrackSize.y = MulDiv(270, ::GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 96); + lpMMI->ptMinTrackSize.x = MulDiv(350, Util::GetDPIx(m_hWnd), 96); + lpMMI->ptMinTrackSize.y = MulDiv(270, Util::GetDPIy(m_hWnd), 96); CDialog::OnGetMinMaxInfo(lpMMI); } Modified: trunk/OpenMPT/mptrack/View_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/View_ins.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -153,8 +153,8 @@ void CViewInstrument::OnInitialUpdate() //------------------------------------- { + CModScrollView::OnInitialUpdate(); ModifyStyleEx(0, WS_EX_ACCEPTFILES); - CModScrollView::OnInitialUpdate(); UpdateScrollSize(); } Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -168,6 +168,7 @@ void CViewPattern::OnInitialUpdate() //---------------------------------- { + CModScrollView::OnInitialUpdate(); MemsetZero(ChnVUMeters); MemsetZero(OldVUMeters); // -> CODE#0012 @@ -186,8 +187,7 @@ m_nPattern = 0; m_nSpacing = 0; m_nAccelChar = 0; - CScrollView::OnInitialUpdate(); - PatternFont::UpdateFont(GetDC()); + PatternFont::UpdateFont(m_hWnd); UpdateSizes(); UpdateScrollSize(); SetCurrentPattern(0); Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -149,10 +149,10 @@ void CViewSample::OnInitialUpdate() //--------------------------------- { + CModScrollView::OnInitialUpdate(); m_dwBeginSel = m_dwEndSel = 0; m_dwStatus.reset(SMPSTATUS_DRAWING); ModifyStyleEx(0, WS_EX_ACCEPTFILES); - CModScrollView::OnInitialUpdate(); CMainFrame *pMainFrm = CMainFrame::GetMainFrame(); if (pMainFrm) { Modified: trunk/OpenMPT/mptrack/dlg_misc.cpp =================================================================== --- trunk/OpenMPT/mptrack/dlg_misc.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/dlg_misc.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -1131,7 +1131,9 @@ // Find out how big our label shall be CSize size; - GetTextExtentPoint32(GetDC()->GetSafeHdc(), description, strlen(description), &size); + HDC dc = ::GetDC(m_hWnd); + GetTextExtentPoint32(dc, description, strlen(description), &size); + ::ReleaseDC(m_hWnd, dc); if(size.cx < 320) size.cx = 320; const int windowWidth = windowRect.Width() - labelRect.Width() + size.cx; const int windowHeight = windowRect.Height() - labelRect.Height() + size.cy; Modified: trunk/OpenMPT/mptrack/view_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/view_com.cpp 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/mptrack/view_com.cpp 2015-01-01 01:52:01 UTC (rev 4695) @@ -108,6 +108,7 @@ void CViewComments::OnInitialUpdate() //----------------------------------- { + CModScrollView::OnInitialUpdate(); if(m_nListId == 0) { m_nListId = IDC_LIST_SAMPLES; Modified: trunk/OpenMPT/plugins/common/WindowBase.h =================================================================== --- trunk/OpenMPT/plugins/common/WindowBase.h 2014-12-31 21:32:40 UTC (rev 4694) +++ trunk/OpenMPT/plugins/common/WindowBase.h 2015-01-01 01:52:01 UTC (rev 4695) @@ -56,9 +56,21 @@ } // Scale X coordinate for DPI-awareness - static int ScaleX(HWND hwnd, int x) { return MulDiv(x, ::GetDeviceCaps(::GetDC(hwnd), LOGPIXELSX), 96); } + static int ScaleX(HWND hwnd, int x) + { + HDC dc = ::GetDC(hwnd); + int dpi = MulDiv(x, ::GetDeviceCaps(dc, LOGPIXELSX), 96); + ::ReleaseDC(hwnd, dc); + return dpi; + } // Scale Y coordinate for DPI-awareness - static int ScaleY(HWND hwnd, int y) { return MulDiv(y, ::GetDeviceCaps(::GetDC(hwnd), LOGPIXELSY), 96); } + static int ScaleY(HWND hwnd, int y) + { + HDC dc = ::GetDC(hwnd); + int dpi = MulDiv(y, ::GetDeviceCaps(dc, LOGPIXELSY), 96); + ::ReleaseDC(hwnd, dc); + return dpi; + } }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-01-03 15:28:12
|
Revision: 4698 http://sourceforge.net/p/modplug/code/4698 Author: saga-games Date: 2015-01-03 15:28:05 +0000 (Sat, 03 Jan 2015) Log Message: ----------- [Fix] Pattern tab: Plugin name box hit check didn't include the two rightmost pixels. [Var] It's 2015. Modified Paths: -------------- trunk/OpenMPT/LICENSE trunk/OpenMPT/common/version.cpp trunk/OpenMPT/installer/packageTemplate/readme.txt trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/mptrack/res/MPTRACK.RC2 trunk/OpenMPT/packageTemplate/readme.txt Modified: trunk/OpenMPT/LICENSE =================================================================== --- trunk/OpenMPT/LICENSE 2015-01-02 10:29:06 UTC (rev 4697) +++ trunk/OpenMPT/LICENSE 2015-01-03 15:28:05 UTC (rev 4698) @@ -1,6 +1,6 @@ The OpenMPT code is licensed under the BSD license. -Copyright (c) 2004-2014, OpenMPT contributors +Copyright (c) 2004-2015, OpenMPT contributors Copyright (c) 1997-2003, Olivier Lapicque All rights reserved. Modified: trunk/OpenMPT/common/version.cpp =================================================================== --- trunk/OpenMPT/common/version.cpp 2015-01-02 10:29:06 UTC (rev 4697) +++ trunk/OpenMPT/common/version.cpp 2015-01-03 15:28:05 UTC (rev 4698) @@ -397,12 +397,12 @@ #else "libopenmpt (based on OpenMPT / ModPlug Tracker)\n" #endif - "Copyright \xC2\xA9 2004-2014 Contributors\n" + "Copyright \xC2\xA9 2004-2015 Contributors\n" "Copyright \xC2\xA9 1997-2003 Olivier Lapicque\n" "\n" "Contributors:\n" - "Johannes Schultz (2008-2014)\n" - "Joern Heusipp (2012-2014)\n" + "Johannes Schultz (2008-2015)\n" + "Joern Heusipp (2012-2015)\n" "Ahti Lepp\xC3\xA4nen (2005-2011)\n" "Robin Fernandes (2004-2007)\n" "Sergiy Pylypenko (2007)\n" Modified: trunk/OpenMPT/installer/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/installer/packageTemplate/readme.txt 2015-01-02 10:29:06 UTC (rev 4697) +++ trunk/OpenMPT/installer/packageTemplate/readme.txt 2015-01-03 15:28:05 UTC (rev 4698) @@ -60,7 +60,7 @@ OpenMPT is partially under the following license: -> Copyright (c) 2004-2014, OpenMPT contributors +> Copyright (c) 2004-2015, OpenMPT contributors > Copyright (c) 1997-2003, Olivier Lapicque > All rights reserved. > Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2015-01-02 10:29:06 UTC (rev 4697) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2015-01-03 15:28:05 UTC (rev 4698) @@ -492,16 +492,15 @@ GetClientRect(&rcClient); xofs = GetXScrollPos(); yofs = GetYScrollPos(); - rect.SetRect(m_szHeader.cx, 0, m_szHeader.cx + GetColumnWidth() /*- 2*/, m_szHeader.cy); - plugRect.SetRect(m_szHeader.cx, m_szHeader.cy - m_szPluginHeader.cy, m_szHeader.cx + GetColumnWidth() - 2, m_szHeader.cy); //rewbs.patPlugNames + rect.SetRect(m_szHeader.cx, 0, m_szHeader.cx + GetColumnWidth(), m_szHeader.cy); + plugRect.SetRect(m_szHeader.cx, m_szHeader.cy - m_szPluginHeader.cy, m_szHeader.cx + GetColumnWidth(), m_szHeader.cy); //rewbs.patPlugNames const CHANNELINDEX nmax = pSndFile->GetNumChannels(); // Checking channel headers - //rewbs.patPlugNames if (m_Status[psShowPluginNames]) { n = xofs; - for(UINT ihdr=0; n<nmax; ihdr++, n++) + for(CHANNELINDEX ihdr = 0; n < nmax; ihdr++, n++) { if (plugRect.PtInRect(point)) { @@ -511,9 +510,8 @@ plugRect.OffsetRect(GetColumnWidth(), 0); } } - //end rewbs.patPlugNames n = xofs; - for (UINT ihdr=0; n<nmax; ihdr++, n++) + for (CHANNELINDEX ihdr=0; n<nmax; ihdr++, n++) { if (rect.PtInRect(point)) { Modified: trunk/OpenMPT/mptrack/res/MPTRACK.RC2 =================================================================== --- trunk/OpenMPT/mptrack/res/MPTRACK.RC2 2015-01-02 10:29:06 UTC (rev 4697) +++ trunk/OpenMPT/mptrack/res/MPTRACK.RC2 2015-01-03 15:28:05 UTC (rev 4698) @@ -43,7 +43,7 @@ VALUE "FileDescription", "OpenMPT / ModPlug Tracker" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "ModPlug Tracker" - VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2014 contributors." + VALUE "LegalCopyright", "Copyright \xA91997-2003 Olivier Lapicque; \xA92004-2015 contributors." VALUE "LegalTrademarks", "M.O.D.P.L.U.G" VALUE "OriginalFilename", "mptrack.exe" VALUE "PrivateBuild", "" Modified: trunk/OpenMPT/packageTemplate/readme.txt =================================================================== --- trunk/OpenMPT/packageTemplate/readme.txt 2015-01-02 10:29:06 UTC (rev 4697) +++ trunk/OpenMPT/packageTemplate/readme.txt 2015-01-03 15:28:05 UTC (rev 4698) @@ -76,7 +76,7 @@ OpenMPT is partially under the following license: -> Copyright (c) 2004-2014, OpenMPT contributors +> Copyright (c) 2004-2015, OpenMPT contributors > Copyright (c) 1997-2003, Olivier Lapicque > All rights reserved. > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-01-04 11:10:24
|
Revision: 4700 http://sourceforge.net/p/modplug/code/4700 Author: manxorist Date: 2015-01-04 11:10:10 +0000 (Sun, 04 Jan 2015) Log Message: ----------- [Var] It's 2015. Modified Paths: -------------- trunk/OpenMPT/libopenmpt/in_openmpt.cpp trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp trunk/OpenMPT/libopenmpt/xmp-openmpt.cpp trunk/OpenMPT/openmpt123/openmpt123.cpp Modified: trunk/OpenMPT/libopenmpt/in_openmpt.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/in_openmpt.cpp 2015-01-04 00:00:50 UTC (rev 4699) +++ trunk/OpenMPT/libopenmpt/in_openmpt.cpp 2015-01-04 11:10:10 UTC (rev 4700) @@ -182,7 +182,7 @@ static void about( HWND hwndParent ) { std::ostringstream about; about << SHORT_TITLE << " version " << openmpt::string::get( openmpt::string::library_version ) << " " << "(built " << openmpt::string::get( openmpt::string::build ) << ")" << std::endl; - about << " Copyright (c) 2013 OpenMPT developers (http://openmpt.org/)" << std::endl; + about << " Copyright (c) 2013-2015 OpenMPT developers (http://openmpt.org/)" << std::endl; about << " OpenMPT version " << openmpt::string::get( openmpt::string::core_version ) << std::endl; about << std::endl; about << openmpt::string::get( openmpt::string::contact ) << std::endl; Modified: trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2015-01-04 00:00:50 UTC (rev 4699) +++ trunk/OpenMPT/libopenmpt/libopenmpt_impl.cpp 2015-01-04 11:10:10 UTC (rev 4700) @@ -40,7 +40,7 @@ static const char * const license = "The OpenMPT code is licensed under the BSD license." "\n" " " "\n" -"Copyright (c) 2004-2014, OpenMPT contributors" "\n" +"Copyright (c) 2004-2015, OpenMPT contributors" "\n" "Copyright (c) 1997-2003, Olivier Lapicque" "\n" "All rights reserved." "\n" "" "\n" Modified: trunk/OpenMPT/libopenmpt/xmp-openmpt.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/xmp-openmpt.cpp 2015-01-04 00:00:50 UTC (rev 4699) +++ trunk/OpenMPT/libopenmpt/xmp-openmpt.cpp 2015-01-04 11:10:10 UTC (rev 4700) @@ -402,7 +402,7 @@ static void WINAPI openmpt_About( HWND win ) { std::ostringstream about; about << SHORT_TITLE << " version " << openmpt::string::get( openmpt::string::library_version ) << " " << "(built " << openmpt::string::get( openmpt::string::build ) << ")" << std::endl; - about << " Copyright (c) 2013 - 2014 OpenMPT developers (http://openmpt.org/)" << std::endl; + about << " Copyright (c) 2013-2015 OpenMPT developers (http://openmpt.org/)" << std::endl; about << " OpenMPT version " << openmpt::string::get( openmpt::string::core_version ) << std::endl; about << std::endl; about << openmpt::string::get( openmpt::string::contact ) << std::endl; Modified: trunk/OpenMPT/openmpt123/openmpt123.cpp =================================================================== --- trunk/OpenMPT/openmpt123/openmpt123.cpp 2015-01-04 00:00:50 UTC (rev 4699) +++ trunk/OpenMPT/openmpt123/openmpt123.cpp 2015-01-04 11:10:10 UTC (rev 4700) @@ -10,7 +10,7 @@ static const char * const license = "The OpenMPT code is licensed under the BSD license." "\n" " " "\n" -"Copyright (c) 2004-2014, OpenMPT contributors" "\n" +"Copyright (c) 2004-2015, OpenMPT contributors" "\n" "Copyright (c) 1997-2003, Olivier Lapicque" "\n" "All rights reserved." "\n" "" "\n" @@ -376,7 +376,7 @@ static void show_info( std::ostream & log, bool verbose ) { log << "openmpt123" << " v" << OPENMPT123_VERSION_STRING << ", libopenmpt " << openmpt::string::get( openmpt::string::library_version ) << " (" << "OpenMPT " << openmpt::string::get( openmpt::string::core_version ) << ")" << std::endl; - log << "Copyright (c) 2013-2014 OpenMPT developers <http://openmpt.org/>" << std::endl; + log << "Copyright (c) 2013-2015 OpenMPT developers <http://openmpt.org/>" << std::endl; if ( !verbose ) { log << std::endl; return; @@ -412,7 +412,7 @@ } static void show_man_version( textout & log ) { - log << "openmpt123" << " v" << OPENMPT123_VERSION_STRING << ", " << "Copyright (c) 2013-2014 OpenMPT developers <http://openmpt.org/>" << std::endl; + log << "openmpt123" << " v" << OPENMPT123_VERSION_STRING << ", " << "Copyright (c) 2013-2015 OpenMPT developers <http://openmpt.org/>" << std::endl; } static void show_short_version( textout & log ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-01-07 09:57:44
|
Revision: 4702 http://sourceforge.net/p/modplug/code/4702 Author: manxorist Date: 2015-01-07 09:57:38 +0000 (Wed, 07 Jan 2015) Log Message: ----------- [Ref] sounddev: enum RequestFlags should be an FlagSet<RequestFlags> . Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/sounddev/SoundDevice.cpp trunk/OpenMPT/sounddev/SoundDevice.h Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2015-01-06 21:24:26 UTC (rev 4701) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2015-01-07 09:57:38 UTC (rev 4702) @@ -1603,15 +1603,15 @@ MPT_TRACE(); if(gpSoundDevice) { - const LONG requestFlags = gpSoundDevice->GetRequestFlags(); - if(requestFlags & SoundDevice::IBase::RequestFlagClose) + const FlagSet<SoundDevice::RequestFlags> requestFlags = gpSoundDevice->GetRequestFlags(); + if(requestFlags[SoundDevice::RequestFlagClose]) { StopPlayback(); audioCloseDevice(); - } else if(requestFlags & SoundDevice::IBase::RequestFlagReset) + } else if(requestFlags[SoundDevice::RequestFlagReset]) { ResetSoundCard(); - } else if(requestFlags & SoundDevice::IBase::RequestFlagRestart) + } else if(requestFlags[SoundDevice::RequestFlagRestart]) { RestartPlayback(); } else Modified: trunk/OpenMPT/sounddev/SoundDevice.cpp =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.cpp 2015-01-06 21:24:26 UTC (rev 4701) +++ trunk/OpenMPT/sounddev/SoundDevice.cpp 2015-01-07 09:57:38 UTC (rev 4702) @@ -396,7 +396,7 @@ m_StreamPositionOutputFrames = 0; } m_Clock.SetResolution(1); - m_RequestFlags.fetch_and(~RequestFlagRestart); + m_RequestFlags.fetch_and((~RequestFlagRestart).as_bits()); if(!InternalStart()) { m_Clock.SetResolution(0); @@ -422,7 +422,7 @@ { InternalStop(); } - m_RequestFlags.fetch_and(~RequestFlagRestart); + m_RequestFlags.fetch_and((~RequestFlagRestart).as_bits()); m_Clock.SetResolution(0); m_IsPlaying = false; { Modified: trunk/OpenMPT/sounddev/SoundDevice.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.h 2015-01-06 21:24:26 UTC (rev 4701) +++ trunk/OpenMPT/sounddev/SoundDevice.h 2015-01-07 09:57:38 UTC (rev 4702) @@ -13,6 +13,7 @@ #include "../common/mutex.h" #include "../common/misc_util.h" +#include "../common/FlagSet.h" #include "../common/mptAtomic.h" #include "../common/ComponentManager.h" #include "../soundlib/SampleFormat.h" @@ -438,6 +439,18 @@ }; +enum RequestFlags +{ + RequestFlagClose = 1<<0, + RequestFlagReset = 1<<1, + RequestFlagRestart = 1<<2, +}; +} // namespace SoundDevice +template <> struct enum_traits<SoundDevice::RequestFlags> { typedef uint32 store_type; }; +namespace SoundDevice { +MPT_DECLARE_ENUM(RequestFlags) + + //========= class IBase //========= @@ -458,12 +471,6 @@ public: - static const uint32 RequestFlagClose = 1<<0; - static const uint32 RequestFlagReset = 1<<1; - static const uint32 RequestFlagRestart = 1<<2; - -public: - virtual void SetSource(SoundDevice::ISource *source) = 0; virtual void SetMessageReceiver(SoundDevice::IMessageReceiver *receiver) = 0; @@ -478,7 +485,7 @@ virtual bool Start() = 0; virtual void Stop(bool force = false) = 0; - virtual uint32 GetRequestFlags() const = 0; + virtual FlagSet<RequestFlags> GetRequestFlags() const = 0; virtual bool IsInited() const = 0; virtual bool IsOpen() const = 0; @@ -613,7 +620,7 @@ bool Start(); void Stop(bool force = false); - uint32 GetRequestFlags() const { return m_RequestFlags.load(); } + FlagSet<RequestFlags> GetRequestFlags() const { return FlagSet<RequestFlags>(m_RequestFlags.load()); } bool IsInited() const { return m_Caps.Available; } bool IsOpen() const { return IsInited() && InternalIsOpen(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-01-08 18:07:31
|
Revision: 4704 http://sourceforge.net/p/modplug/code/4704 Author: manxorist Date: 2015-01-08 18:07:17 +0000 (Thu, 08 Jan 2015) Log Message: ----------- [Var] libopenmpt: Add .clang-format (matching almost the current libopenmpt identation style) for the libopenmpt examples and reformat them with v3.5. Add a build/svn/run_clang-format.sh script which does the reformatting. Modified Paths: -------------- trunk/OpenMPT/README.md trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_stdout.c trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp Added Paths: ----------- trunk/OpenMPT/build/svn/run_clang-format.sh trunk/OpenMPT/libopenmpt/examples/.clang-format Property Changed: ---------------- trunk/OpenMPT/ Index: trunk/OpenMPT =================================================================== --- trunk/OpenMPT 2015-01-08 16:44:52 UTC (rev 4703) +++ trunk/OpenMPT 2015-01-08 18:07:17 UTC (rev 4704) Property changes on: trunk/OpenMPT ___________________________________________________________________ Modified: svn:auto-props ## -48,3 +48,8 ## *.bmp = svn:mime-type=image/x-ms-bmp *.BMP = svn:mime-type=image/x-ms-bmp *.png = svn:mime-type=image/png + +.clang-format = svn:mime-type=text/x-clang-format;svn:eol-style=native +.clang-format-* = svn:mime-type=text/x-clang-format;svn:eol-style=native +*.clang-format = svn:mime-type=text/x-clang-format;svn:eol-style=native +*.clang-format-* = svn:mime-type=text/x-clang-format;svn:eol-style=native Modified: trunk/OpenMPT/README.md =================================================================== --- trunk/OpenMPT/README.md 2015-01-08 16:44:52 UTC (rev 4703) +++ trunk/OpenMPT/README.md 2015-01-08 18:07:17 UTC (rev 4704) @@ -238,7 +238,8 @@ functionaly (especially iostream), always imbue the `std::locale::classic()` locale. - Prefer kernel_style_names over CamelCaseNames. - - Indentation: + - If a folder (or one of its parent folders) contains .clang-format, + use clang-format v3.5 for indenting C++ and C files, otherwise: - `{` are placed at the end of the opening line. - Enclose even single statements in curly braces. - Avoid placing single statements on the same line as the `if`. Added: trunk/OpenMPT/build/svn/run_clang-format.sh =================================================================== --- trunk/OpenMPT/build/svn/run_clang-format.sh (rev 0) +++ trunk/OpenMPT/build/svn/run_clang-format.sh 2015-01-08 18:07:17 UTC (rev 4704) @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +#cd libopenmpt +# clang-format-3.5 -i *.h *.c *.hpp *.cpp +#cd .. + +cd libopenmpt/examples + clang-format-3.5 -i *.c *.cpp +cd ../.. Property changes on: trunk/OpenMPT/build/svn/run_clang-format.sh ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/x-sh \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: trunk/OpenMPT/libopenmpt/examples/.clang-format =================================================================== --- trunk/OpenMPT/libopenmpt/examples/.clang-format (rev 0) +++ trunk/OpenMPT/libopenmpt/examples/.clang-format 2015-01-08 18:07:17 UTC (rev 4704) @@ -0,0 +1,55 @@ +# clang-format 3.5 +# +Language: Cpp +# +AccessModifierOffset: -2 +AlignEscapedNewlinesLeft: true +AlignTrailingComments: false +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: false +BinPackParameters: false +BreakBeforeBinaryOperators: false +BreakBeforeBraces: Attach +BreakBeforeTernaryOperators: false +BreakConstructorInitializersBeforeComma: true +ColumnLimit: 0 +CommentPragmas: '^ IWYU pragma:' +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 2 +ContinuationIndentWidth: 2 +Cpp11BracedListStyle: false +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +IndentCaseLabels: false +IndentFunctionDeclarationAfterType: false +IndentWidth: 2 +KeepEmptyLinesAtTheStartOfBlocks: true +MaxEmptyLinesToKeep: 3 +NamespaceIndentation: None +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 60 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Middle +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: true +SpacesInCStyleCastParentheses: false +SpacesInParentheses: true +Standard: Cpp03 +TabWidth: 2 +UseTab: ForIndentation Property changes on: trunk/OpenMPT/libopenmpt/examples/.clang-format ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/x-clang-format \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Modified: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c =================================================================== --- trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c 2015-01-08 16:44:52 UTC (rev 4703) +++ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c.c 2015-01-08 18:07:17 UTC (rev 4704) @@ -23,36 +23,36 @@ static int16_t left[BUFFERSIZE]; static int16_t right[BUFFERSIZE]; -static int16_t* const buffers[2] = {left,right}; +static int16_t * const buffers[2] = { left, right }; -int main(int argc,char* argv[]){ - FILE* file = 0; - openmpt_module* mod = 0; +int main( int argc, char * argv[] ) { + FILE * file = 0; + openmpt_module * mod = 0; size_t count = 0; - PaStream* stream = 0; + PaStream * stream = 0; PaStreamParameters streamparameters; - memset(&streamparameters,0,sizeof(PaStreamParameters)); + memset( &streamparameters, 0, sizeof( PaStreamParameters ) ); (void)argc; - file = fopen(argv[1],"rb"); - mod = openmpt_module_create(openmpt_stream_get_file_callbacks(),file,NULL,NULL,NULL); - fclose(file); + file = fopen( argv[1], "rb" ); + mod = openmpt_module_create( openmpt_stream_get_file_callbacks(), file, NULL, NULL, NULL ); + fclose( file ); Pa_Initialize(); streamparameters.device = Pa_GetDefaultOutputDevice(); streamparameters.channelCount = 2; - streamparameters.sampleFormat = paInt16|paNonInterleaved; - streamparameters.suggestedLatency = Pa_GetDeviceInfo(streamparameters.device)->defaultHighOutputLatency; - Pa_OpenStream(&stream,NULL,&streamparameters,SAMPLERATE,paFramesPerBufferUnspecified,0,NULL,NULL); - Pa_StartStream(stream); - while(1){ - count = openmpt_module_read_stereo(mod,SAMPLERATE,BUFFERSIZE,left,right); - if(count==0){ + streamparameters.sampleFormat = paInt16 | paNonInterleaved; + streamparameters.suggestedLatency = Pa_GetDeviceInfo( streamparameters.device )->defaultHighOutputLatency; + Pa_OpenStream( &stream, NULL, &streamparameters, SAMPLERATE, paFramesPerBufferUnspecified, 0, NULL, NULL ); + Pa_StartStream( stream ); + while ( 1 ) { + count = openmpt_module_read_stereo( mod, SAMPLERATE, BUFFERSIZE, left, right ); + if ( count == 0 ) { break; } - Pa_WriteStream(stream,buffers,count); + Pa_WriteStream( stream, buffers, count ); } - Pa_StopStream(stream); - Pa_CloseStream(stream); + Pa_StopStream( stream ); + Pa_CloseStream( stream ); Pa_Terminate(); - openmpt_module_destroy(mod); + openmpt_module_destroy( mod ); return 0; } Modified: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c =================================================================== --- trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c 2015-01-08 16:44:52 UTC (rev 4703) +++ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_mem.c 2015-01-08 18:07:17 UTC (rev 4704) @@ -22,44 +22,44 @@ static int16_t left[BUFFERSIZE]; static int16_t right[BUFFERSIZE]; -static int16_t* const buffers[2] = {left,right}; +static int16_t * const buffers[2] = { left, right }; -int main(int argc,char* argv[]){ - FILE* file = 0; +int main( int argc, char * argv[] ) { + FILE * file = 0; size_t size = 0; - void* data = 0; - openmpt_module* mod = 0; + void * data = 0; + openmpt_module * mod = 0; size_t count = 0; - PaStream* stream = 0; + PaStream * stream = 0; PaStreamParameters streamparameters; - memset(&streamparameters,0,sizeof(PaStreamParameters)); + memset( &streamparameters, 0, sizeof( PaStreamParameters ) ); (void)argc; - file = fopen(argv[1],"rb"); - fseek(file,0,SEEK_END); - size = ftell(file); - fseek(file,0,SEEK_SET); - data = malloc(size); - size = fread(data,1,size,file); - fclose(file); - mod = openmpt_module_create_from_memory(data,size,NULL,NULL,NULL); - free(data); + file = fopen( argv[1], "rb" ); + fseek( file, 0, SEEK_END ); + size = ftell( file ); + fseek( file, 0, SEEK_SET ); + data = malloc( size ); + size = fread( data, 1, size, file ); + fclose( file ); + mod = openmpt_module_create_from_memory( data, size, NULL, NULL, NULL ); + free( data ); Pa_Initialize(); streamparameters.device = Pa_GetDefaultOutputDevice(); streamparameters.channelCount = 2; - streamparameters.sampleFormat = paInt16|paNonInterleaved; - streamparameters.suggestedLatency = Pa_GetDeviceInfo(streamparameters.device)->defaultHighOutputLatency; - Pa_OpenStream(&stream,NULL,&streamparameters,SAMPLERATE,paFramesPerBufferUnspecified,0,NULL,NULL); - Pa_StartStream(stream); - while(1){ - count = openmpt_module_read_stereo(mod,SAMPLERATE,BUFFERSIZE,left,right); - if(count==0){ + streamparameters.sampleFormat = paInt16 | paNonInterleaved; + streamparameters.suggestedLatency = Pa_GetDeviceInfo( streamparameters.device )->defaultHighOutputLatency; + Pa_OpenStream( &stream, NULL, &streamparameters, SAMPLERATE, paFramesPerBufferUnspecified, 0, NULL, NULL ); + Pa_StartStream( stream ); + while ( 1 ) { + count = openmpt_module_read_stereo( mod, SAMPLERATE, BUFFERSIZE, left, right ); + if ( count == 0 ) { break; } - Pa_WriteStream(stream,buffers,count); + Pa_WriteStream( stream, buffers, count ); } - Pa_StopStream(stream); - Pa_CloseStream(stream); + Pa_StopStream( stream ); + Pa_CloseStream( stream ); Pa_Terminate(); - openmpt_module_destroy(mod); + openmpt_module_destroy( mod ); return 0; } Modified: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_stdout.c =================================================================== --- trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_stdout.c 2015-01-08 16:44:52 UTC (rev 4703) +++ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_c_stdout.c 2015-01-08 18:07:17 UTC (rev 4704) @@ -31,13 +31,13 @@ #define BUFFERSIZE 480 #define SAMPLERATE 48000 -static ssize_t xwrite(int fd, const void* buffer, size_t size){ +static ssize_t xwrite( int fd, const void * buffer, size_t size ) { size_t written = 0; ssize_t retval = 0; - while(written<size){ - retval = write(fd,(const char*)buffer+written,size-written); - if(retval<0){ - if(errno!=EINTR){ + while ( written < size ) { + retval = write( fd, (const char *)buffer + written, size - written ); + if ( retval < 0 ) { + if ( errno != EINTR ) { break; } retval = 0; @@ -47,24 +47,23 @@ return written; } -static int16_t buffer[BUFFERSIZE*2]; +static int16_t buffer[BUFFERSIZE * 2]; -int main(int argc,char* argv[]){ - FILE* file = 0; - openmpt_module* mod = 0; +int main( int argc, char * argv[] ) { + FILE * file = 0; + openmpt_module * mod = 0; size_t count = 0; (void)argc; - file = fopen(argv[1],"rb"); - mod = openmpt_module_create(openmpt_stream_get_file_callbacks(),file,NULL,NULL,NULL); - fclose(file); - while(1){ - count = openmpt_module_read_interleaved_stereo(mod,SAMPLERATE,BUFFERSIZE,buffer); - if(count==0){ + file = fopen( argv[1], "rb" ); + mod = openmpt_module_create( openmpt_stream_get_file_callbacks(), file, NULL, NULL, NULL ); + fclose( file ); + while ( 1 ) { + count = openmpt_module_read_interleaved_stereo( mod, SAMPLERATE, BUFFERSIZE, buffer ); + if ( count == 0 ) { break; } - xwrite(STDOUT_FILENO,buffer,count*2*sizeof(int16_t)); + xwrite( STDOUT_FILENO, buffer, count * 2 * sizeof( int16_t ) ); } - openmpt_module_destroy(mod); + openmpt_module_destroy( mod ); return 0; } - Modified: trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp =================================================================== --- trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp 2015-01-08 16:44:52 UTC (rev 4703) +++ trunk/OpenMPT/libopenmpt/examples/libopenmpt_example_cxx.cpp 2015-01-08 18:07:17 UTC (rev 4704) @@ -16,7 +16,7 @@ #include <portaudio.h> -int main( int /*argc*/, char * argv [] ) { +int main( int /*argc*/, char * argv[] ) { const std::size_t buffersize = 480; const std::int32_t samplerate = 48000; std::vector<float> left( buffersize ); @@ -26,7 +26,7 @@ Pa_Initialize(); PaStream * stream = 0; PaStreamParameters streamparameters; - std::memset( &streamparameters, 0, sizeof(PaStreamParameters) ); + std::memset( &streamparameters, 0, sizeof( PaStreamParameters ) ); streamparameters.device = Pa_GetDefaultOutputDevice(); streamparameters.channelCount = 2; streamparameters.sampleFormat = paFloat32 | paNonInterleaved; @@ -38,7 +38,7 @@ if ( count == 0 ) { break; } - const float * const buffers [2] = { left.data(), right.data() }; + const float * const buffers[2] = { left.data(), right.data() }; Pa_WriteStream( stream, buffers, count ); } Pa_StopStream( stream ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-01-08 23:41:41
|
Revision: 4706 http://sourceforge.net/p/modplug/code/4706 Author: saga-games Date: 2015-01-08 23:41:32 +0000 (Thu, 08 Jan 2015) Log Message: ----------- [Fix] Channel borders were not drawn properly with zoomed fonts. [Mod] Change character for empty cells in custom pattern fonts from mid-dot to regular dot, so that it looks better in fonts that lack unicode character (such as Terminal), and since it actually matches OpenMPT's default font better. [Mod] OpenMPT: Version is now 1.24.01.05 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/PatternFont.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2015-01-08 22:24:04 UTC (rev 4705) +++ trunk/OpenMPT/common/versionNumber.h 2015-01-08 23:41:32 UTC (rev 4706) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 24 #define VER_MINOR 01 -#define VER_MINORMINOR 04 +#define VER_MINORMINOR 05 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/PatternFont.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternFont.cpp 2015-01-08 22:24:04 UTC (rev 4705) +++ trunk/OpenMPT/mptrack/PatternFont.cpp 2015-01-08 23:41:32 UTC (rev 4706) @@ -228,7 +228,7 @@ // Create 4-pixel border const int bmWidth2 = pf.dib->bmiHeader.biWidth / 2; - for(int y = 0, x = pf.nClrY * bmWidth2 + (pf.nClrX + pf.nWidth - 4) / 2; y < pf.nHeight; y++, x += bmWidth2) + for(int y = 0, x = (customFontBitmap.bmiHeader.biHeight - pf.nClrY - pf.nHeight) * bmWidth2 + (pf.nClrX + pf.nWidth - 4) / 2; y < pf.nHeight; y++, x += bmWidth2) { pf.dib->lpDibBits[x] = 0xEC; pf.dib->lpDibBits[x + 1] = 0xC4; @@ -329,7 +329,7 @@ uint8_t dot = dots[cell]; for(int i = 0; dot != 0; i++) { - if(dot & 1) DrawChar(hDC, L'\u00B7', pf.nClrX + offset + i * charWidth, pf.nClrY, charWidth, charHeight); + if(dot & 1) DrawChar(hDC, '.', pf.nClrX + offset + i * charWidth, pf.nClrY, charWidth, charHeight); dot >>= 1; } offset += pf.nEltWidths[cell]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-01-10 13:22:30
|
Revision: 4707 http://sourceforge.net/p/modplug/code/4707 Author: saga-games Date: 2015-01-10 13:22:17 +0000 (Sat, 10 Jan 2015) Log Message: ----------- [Imp] Pattern tab: Show verbose effect descriptions in the status bar instead of the short versions (as a side effect, this fixes http://bugs.openmpt.org/view.php?id=51) Modified Paths: -------------- trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/EffectInfo.cpp trunk/OpenMPT/mptrack/EffectInfo.h trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp trunk/OpenMPT/soundlib/MIDIMacros.cpp Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2015-01-08 23:41:32 UTC (rev 4706) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2015-01-10 13:22:17 UTC (rev 4707) @@ -124,7 +124,7 @@ m_szHeader.cx = ROWHDR_WIDTH; m_szHeader.cy = COLHDR_HEIGHT; m_szPluginHeader.cx = 0; - m_szPluginHeader.cy = m_Status[psShowPluginNames] ? PLUGNAME_HEIGHT : 0; + m_szPluginHeader.cy = m_Status[psShowPluginNames] ? MulDiv(PLUGNAME_HEIGHT, m_nDPIy, 96) : 0; if(m_Status[psShowVUMeters]) m_szHeader.cy += VUMETERS_HEIGHT; m_szCell.cx = 4 + pfnt->nEltWidths[0]; if (m_nDetailLevel >= PatternCursor::instrColumn) m_szCell.cx += pfnt->nEltWidths[1]; @@ -134,7 +134,6 @@ m_szHeader.cx = MulDiv(m_szHeader.cx, m_nDPIx, 96); m_szHeader.cy = MulDiv(m_szHeader.cy, m_nDPIy, 96); - m_szPluginHeader.cy = MulDiv(m_szPluginHeader.cy, m_nDPIy, 96); m_szHeader.cy += m_szPluginHeader.cy; if(oldy != m_szCell.cy) @@ -468,7 +467,7 @@ const int vuHeight = MulDiv(VUMETERS_HEIGHT, m_nDPIy, 96); const int colHeight = MulDiv(COLHDR_HEIGHT, m_nDPIy, 96); - const int recordInsX = MulDiv(3, m_nDPIy, 96); + const int recordInsX = MulDiv(3, m_nDPIx, 96); GetClientRect(&rcClient); hdc = pDC->m_hDC; @@ -1612,14 +1611,14 @@ s.Format(_T("Parameter value: %u"), m->GetValueEffectCol()); } else if(m->command != CMD_NONE) { - TCHAR sztmp[64] = ""; - /*LONG fxndx = effectInfo.GetIndexFromEffect(m->command, m->param); + TCHAR sztmp[128] = ""; + LONG fxndx = effectInfo.GetIndexFromEffect(m->command, m->param); if(fxndx >= 0) { - effectInfo.GetEffectNameEx(sztmp, fxndx, m->param); - }*/ - effectInfo.GetEffectName(sztmp, m->command, m->param, false, nChn); - if(sztmp[0]) s.Format(_T("%s (%02X)"), sztmp, m->param); + effectInfo.GetEffectNameEx(sztmp, fxndx, m->param, nChn); + } + //effectInfo.GetEffectName(sztmp, m->command, m->param, false, nChn); + if(sztmp[0]) s.Format(_T("%c%02X: %s"), pSndFile->GetModSpecifications().GetEffectLetter(m->command), m->param, sztmp); } break; } Modified: trunk/OpenMPT/mptrack/EffectInfo.cpp =================================================================== --- trunk/OpenMPT/mptrack/EffectInfo.cpp 2015-01-08 23:41:32 UTC (rev 4706) +++ trunk/OpenMPT/mptrack/EffectInfo.cpp 2015-01-10 13:22:17 UTC (rev 4707) @@ -145,8 +145,8 @@ } -bool EffectInfo::GetEffectName(LPSTR pszDescription, ModCommand::COMMAND command, UINT param, bool bXX, CHANNELINDEX nChn) const -//------------------------------------------------------------------------------------------------------------------------------ +bool EffectInfo::GetEffectName(LPSTR pszDescription, ModCommand::COMMAND command, UINT param, bool bXX) const +//----------------------------------------------------------------------------------------------------------- { bool bSupported; UINT fxndx = CountOf(gFXInfo); @@ -176,48 +176,6 @@ if ((gFXInfo[fxndx].paramMask & 0x0F) == 0x0F) pszDescription[2] = szHexChar[gFXInfo[fxndx].paramValue & 0x0F]; } strcat(pszDescription, gFXInfo[fxndx].name); - //Get channel specific info - if (nChn < sndFile.GetNumChannels()) - { - CString chanSpec = ""; - size_t macroIndex = size_t(-1); - - switch (command) - { - case CMD_MODCMDEX: - case CMD_S3MCMDEX: - if ((param & 0xF0) == 0xF0 && !(sndFile.GetType() & MOD_TYPE_MOD)) //Set Macro - { - macroIndex = (param & 0x0F); - chanSpec.Format(" to %d: ", param & 0x0F); - } - break; - - case CMD_MIDI: - case CMD_SMOOTHMIDI: - if (param < 0x80 && nChn != CHANNELINDEX_INVALID) - { - macroIndex = sndFile.m_PlayState.Chn[nChn].nActiveMacro; - chanSpec.Format(": currently %d: ", sndFile.m_PlayState.Chn[nChn].nActiveMacro); - } - else - { - chanSpec = " (Fixed)"; - } - break; - } - - if(macroIndex != size_t(-1)) - { - const PLUGINDEX plugin = sndFile.GetBestPlugin(nChn, PrioritiseChannel, EvenIfMuted) - 1; - chanSpec.Append(sndFile.m_MidiCfg.GetParameteredMacroName(macroIndex, plugin, sndFile)); - } - if (!chanSpec.IsEmpty()) - { - strcat(pszDescription, chanSpec); - } - - } } return bSupported; } @@ -466,10 +424,10 @@ } -bool EffectInfo::GetEffectNameEx(LPSTR pszName, UINT ndx, UINT param) const -//------------------------------------------------------------------------- +bool EffectInfo::GetEffectNameEx(LPSTR pszName, UINT ndx, UINT param, CHANNELINDEX chn) const +//------------------------------------------------------------------------------------------- { - char s[64]; + char s[128]; char szContinueOrIgnore[16]; if (pszName) pszName[0] = 0; @@ -670,7 +628,15 @@ case CMD_SMOOTHMIDI: if (param < 0x80) { - wsprintf(pszName, "SFx macro: z=%02X (%d)", param, param); + if(chn != CHANNELINDEX_INVALID) + { + const uint8 macroIndex = sndFile.m_PlayState.Chn[chn].nActiveMacro; + const PLUGINDEX plugin = sndFile.GetBestPlugin(chn, PrioritiseChannel, EvenIfMuted) - 1; + wsprintf(pszName, "SFx MIDI Macro z=%d (SF%X: %s)", param, macroIndex, sndFile.m_MidiCfg.GetParameteredMacroName(macroIndex, plugin, sndFile)); + } else + { + wsprintf(pszName, "SFx macro: z=%02X (%d)", param, param); + } } else { wsprintf(pszName, "Fixed Macro Z%02X", param); @@ -791,8 +757,7 @@ strcat(s, " rows"); break; case 0xF0: // macro - if(sndFile.GetType() != MOD_TYPE_MOD) - wsprintf(s, "SF%X", param & 0x0F); + strcpy(s, sndFile.m_MidiCfg.GetParameteredMacroName(param & 0x0F, PLUGINDEX_INVALID, sndFile)); break; default: break; @@ -861,11 +826,11 @@ if((param & 0x0F) == 0) strcpy(s, "Stop"); else - wsprintf(s, "Speed %d", param & 0x0F); + wsprintf(s, "Speed %d", param & 0x0F); } else { // macro - wsprintf(s, "SF%X", param & 0x0F); + strcpy(s, sndFile.m_MidiCfg.GetParameteredMacroName(param & 0x0F, PLUGINDEX_INVALID, sndFile)); } break; default: Modified: trunk/OpenMPT/mptrack/EffectInfo.h =================================================================== --- trunk/OpenMPT/mptrack/EffectInfo.h 2015-01-08 23:41:32 UTC (rev 4706) +++ trunk/OpenMPT/mptrack/EffectInfo.h 2015-01-10 13:22:17 UTC (rev 4707) @@ -29,8 +29,7 @@ // Effects Description - // Get basic effect name with some additional information for some effects - bool GetEffectName(LPSTR pszDescription, ModCommand::COMMAND command, UINT param, bool bXX = false, CHANNELINDEX nChn = CHANNELINDEX_INVALID) const; // bXX: Nxx: ... + bool GetEffectName(LPSTR pszDescription, ModCommand::COMMAND command, UINT param, bool bXX = false) const; // bXX: Nxx: ... // Get size of list of known effect commands UINT GetNumEffects() const; // Get range information, effect name, etc... from a given effect. @@ -43,7 +42,7 @@ // Get parameter mask from effect (for extended effects) UINT GetEffectMaskFromIndex(UINT ndx) const; // Get precise effect name, also with explanation of effect parameter - bool GetEffectNameEx(LPSTR pszName, UINT ndx, UINT param) const; + bool GetEffectNameEx(LPSTR pszName, UINT ndx, UINT param, CHANNELINDEX chn = CHANNELINDEX_INVALID) const; // Check whether an effect is extended (with parameter nibbles) bool IsExtendedEffect(UINT ndx) const; // Map an effect value to slider position Modified: trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp =================================================================== --- trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2015-01-08 23:41:32 UTC (rev 4706) +++ trunk/OpenMPT/mptrack/PatternEditorDialogs.cpp 2015-01-10 13:22:17 UTC (rev 4707) @@ -1091,7 +1091,7 @@ if(fxndx >= 0) { newParam = static_cast<ModCommand::PARAM>(effectInfo.MapPosToValue(fxndx, sldParam.GetPos())); - effectInfo.GetEffectNameEx(s, fxndx, newParam * xMultiplier + xParam); + effectInfo.GetEffectNameEx(s, fxndx, newParam * xMultiplier + xParam, editPos.channel); } } SetDlgItemText(IDC_TEXT1, s); Modified: trunk/OpenMPT/soundlib/MIDIMacros.cpp =================================================================== --- trunk/OpenMPT/soundlib/MIDIMacros.cpp 2015-01-08 23:41:32 UTC (rev 4706) +++ trunk/OpenMPT/soundlib/MIDIMacros.cpp 2015-01-10 13:22:17 UTC (rev 4707) @@ -222,35 +222,33 @@ case sfx_plug: { const int param = MacroToPlugParam(macroIndex); - CString paramName; - + CString formattedName; + formattedName.Format(_T("Param %u"), param); #ifndef NO_VST if(plugin < MAX_MIXPLUGINS) { CVstPlugin *pPlug = dynamic_cast<CVstPlugin *>(sndFile.m_MixPlugins[plugin].pMixPlugin); if(pPlug) { + CString paramName; paramName = pPlug->GetParamName(param); + if(!paramName.IsEmpty()) + { + formattedName.AppendFormat(_T(" (%s)"), paramName); + } } - if (paramName.IsEmpty()) - { - return TEXT("N/A"); - } - - CString formattedName; - formattedName.Format(TEXT("Param %d (%s)"), param, paramName); - return formattedName; } else #endif // NO_VST { - return TEXT("N/A - No Plugin"); + formattedName += _T(" (N/A)"); } + return formattedName; } case sfx_cc: { CString formattedCC; - formattedCC.Format(TEXT("MIDI CC %d"), MacroToMidiCC(macroIndex)); + formattedCC.Format(_T("MIDI CC %u"), MacroToMidiCC(macroIndex)); return formattedCC; } @@ -267,26 +265,26 @@ switch(macroType) { case sfx_unused: - return TEXT("Unused"); + return _T("Unused"); case sfx_cutoff: - return TEXT("Set Filter Cutoff"); + return _T("Set Filter Cutoff"); case sfx_reso: - return TEXT("Set Filter Resonance"); + return _T("Set Filter Resonance"); case sfx_mode: - return TEXT("Set Filter Mode"); + return _T("Set Filter Mode"); case sfx_drywet: - return TEXT("Set Plugin Dry/Wet Ratio"); + return _T("Set Plugin Dry/Wet Ratio"); case sfx_plug: - return TEXT("Control Plugin Parameter..."); + return _T("Control Plugin Parameter..."); case sfx_cc: - return TEXT("MIDI CC..."); + return _T("MIDI CC..."); case sfx_channelAT: - return TEXT("Channel Aftertouch"); + return _T("Channel Aftertouch"); case sfx_polyAT: - return TEXT("Polyphonic Aftertouch"); + return _T("Polyphonic Aftertouch"); case sfx_custom: default: - return TEXT("Custom"); + return _T("Custom"); } } @@ -298,24 +296,24 @@ switch(macroType) { case zxx_unused: - return TEXT("Unused"); + return _T("Unused"); case zxx_reso4Bit: - return TEXT("Z80 - Z8F controls Resonant Filter Resonance"); + return _T("Z80 - Z8F controls Resonant Filter Resonance"); case zxx_reso7Bit: - return TEXT("Z80 - ZFF controls Resonant Filter Resonance"); + return _T("Z80 - ZFF controls Resonant Filter Resonance"); case zxx_cutoff: - return TEXT("Z80 - ZFF controls Resonant Filter Cutoff"); + return _T("Z80 - ZFF controls Resonant Filter Cutoff"); case zxx_mode: - return TEXT("Z80 - ZFF controls Resonant Filter Mode"); + return _T("Z80 - ZFF controls Resonant Filter Mode"); case zxx_resomode: - return TEXT("Z80 - Z9F controls Resonance + Filter Mode"); + return _T("Z80 - Z9F controls Resonance + Filter Mode"); case zxx_channelAT: - return TEXT("Z80 - ZFF controls Channel Aftertouch"); + return _T("Z80 - ZFF controls Channel Aftertouch"); case zxx_polyAT: - return TEXT("Z80 - ZFF controls Polyphonic Aftertouch"); + return _T("Z80 - ZFF controls Polyphonic Aftertouch"); case zxx_custom: default: - return TEXT("Custom"); + return _T("Custom"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-01-11 17:34:22
|
Revision: 4712 http://sourceforge.net/p/modplug/code/4712 Author: saga-games Date: 2015-01-11 17:34:09 +0000 (Sun, 11 Jan 2015) Log Message: ----------- [Fix] Sample tab: Splitting a stereo sample into two mono samples didn't update the sample list in other tabs. [Fix] IT Compatibility: Panbrello should not reset until the next note or panning command (test case: PanbrelloHold.it) [Mod] OpenMPT: Version is now 1.24.01.06 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/soundlib/ModChannel.h trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2015-01-10 18:53:02 UTC (rev 4711) +++ trunk/OpenMPT/common/versionNumber.h 2015-01-11 17:34:09 UTC (rev 4712) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 24 #define VER_MINOR 01 -#define VER_MINORMINOR 05 +#define VER_MINORMINOR 06 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2015-01-10 18:53:02 UTC (rev 4711) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2015-01-11 17:34:09 UTC (rev 4712) @@ -2349,7 +2349,7 @@ right.nPan = 256; } } - SetModified(SampleHint().Info().Data(), true, true); + SetModified(SampleHint().Info().Data().Names(), true, true); } else { pModDoc->GetSampleUndo().RemoveLastUndoStep(m_nSample); @@ -2934,7 +2934,7 @@ case kcSampleCenterSustainEnd: if(m_nZoom) { - SmpLength point; + SmpLength point = 0; ModSample &sample = sndFile.GetSample(m_nSample); switch(wParam) { Modified: trunk/OpenMPT/soundlib/ModChannel.h =================================================================== --- trunk/OpenMPT/soundlib/ModChannel.h 2015-01-10 18:53:02 UTC (rev 4711) +++ trunk/OpenMPT/soundlib/ModChannel.h 2015-01-11 17:34:09 UTC (rev 4712) @@ -97,7 +97,7 @@ uint8 nVibratoType, nVibratoSpeed, nVibratoDepth; uint8 nTremoloType, nTremoloSpeed, nTremoloDepth; uint8 nPanbrelloType, nPanbrelloSpeed, nPanbrelloDepth; - int8 nPanbrelloRandomMemory; + int8 nPanbrelloOffset, nPanbrelloRandomMemory; uint8 nOldCmdEx, nOldVolParam, nOldTempo; uint8 nOldOffset, nOldHiOffset; uint8 nCutOff, nResonance; Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2015-01-10 18:53:02 UTC (rev 4711) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2015-01-11 17:34:09 UTC (rev 4712) @@ -149,7 +149,7 @@ CHN_VOLUMERAMP = 0x8000, // Apply volume ramping CHN_VIBRATO = 0x10000, // Apply vibrato CHN_TREMOLO = 0x20000, // Apply tremolo - CHN_PANBRELLO = 0x40000, // Apply panbrello + //CHN_PANBRELLO = 0x40000, // Apply panbrello CHN_PORTAMENTO = 0x80000, // Apply portamento CHN_GLISSANDO = 0x100000, // Glissando mode CHN_FASTVOLRAMP = 0x200000, // Force usage of global ramping settings instead of ramping over the complete render buffer length Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-01-10 18:53:02 UTC (rev 4711) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-01-11 17:34:09 UTC (rev 4712) @@ -98,13 +98,8 @@ // Get mod length in various cases. Parameters: // [in] adjustMode: See enmGetLengthResetMode for possible adjust modes. -// [in] target: Time or position target which should be reached, or no target to get length of the first sub song. -// [out] duration: total time in seconds -// [out] targetReached: true if the specified target has been reached while going through the module. -// [out] lastOrder: last parsed order (if no target is specified, this is the first order that is parsed twice, i.e. not the *last* played order) -// [out] lastRow: last parsed row (ditto) -// [out] endOrder: last order before module loops (UNDEFINED if a target is specified) -// [out] endRow: last row before module loops (ditto) +// [in] target: Time or position target which should be reached, or no target to get length of the first sub song. Use GetLengthTarget::StartPos to also specify a position from where the seeking should begin. +// [out] See definition of type GetLengthType for the returned values. std::vector<GetLengthType> CSoundFile::GetLength(enmGetLengthResetMode adjustMode, GetLengthTarget target) //-------------------------------------------------------------------------------------------------------- { @@ -1158,8 +1153,6 @@ if(pIns->IsCutoffEnabled()) pChn->nCutOff = pIns->GetCutoff(); if(pIns->IsResonanceEnabled()) pChn->nResonance = pIns->GetResonance(); } - pChn->nVolSwing = pChn->nPanSwing = 0; - pChn->nResSwing = pChn->nCutSwing = 0; } if(pSmp == nullptr) @@ -1349,6 +1342,7 @@ pChn->nNewIns = 0; UINT period = GetPeriodFromNote(note, pChn->nFineTune, pChn->nC5Speed); + pChn->nPanbrelloOffset = 0; if(!pSmp) return; if(period) @@ -1627,7 +1621,8 @@ ModChannel &chn = m_PlayState.Chn[n]; // Copy Channel chn = *pChn; - chn.dwFlags.reset(CHN_VIBRATO | CHN_TREMOLO | CHN_PANBRELLO | CHN_MUTE | CHN_PORTAMENTO); + chn.dwFlags.reset(CHN_VIBRATO | CHN_TREMOLO | CHN_MUTE | CHN_PORTAMENTO); + chn.nPanbrelloOffset = 0; chn.nMasterChn = nChn + 1; chn.nCommand = CMD_NONE; chn.rowCommand.Clear(); @@ -1792,7 +1787,8 @@ ModChannel *p = &m_PlayState.Chn[n]; // Copy Channel *p = *pChn; - p->dwFlags.reset(CHN_VIBRATO | CHN_TREMOLO | CHN_PANBRELLO | CHN_MUTE | CHN_PORTAMENTO); + p->dwFlags.reset(CHN_VIBRATO | CHN_TREMOLO | CHN_MUTE | CHN_PORTAMENTO); + p->nPanbrelloOffset = 0; //rewbs: Copy mute and FX status from master chan. //I'd like to copy other flags too, but this would change playback behaviour. @@ -2349,7 +2345,10 @@ pChn->nRestorePanOnNewNote = 0; //IT compatibility 20. Set pan overrides random pan if(IsCompatibleMode(TRK_IMPULSETRACKER)) + { pChn->nPanSwing = 0; + pChn->nPanbrelloOffset = 0; + } } #ifdef MODPLUG_TRACKER @@ -3453,7 +3452,6 @@ { if (param & 0x0F) p->nPanbrelloDepth = param & 0x0F; if (param & 0xF0) p->nPanbrelloSpeed = (param >> 4) & 0x0F; - p->dwFlags.set(CHN_PANBRELLO); } @@ -3484,7 +3482,10 @@ pChn->nRestorePanOnNewNote = 0; //IT compatibility 20. Set pan overrides random pan if(IsCompatibleMode(TRK_IMPULSETRACKER)) + { pChn->nPanSwing = 0; + pChn->nPanbrelloOffset = 0; + } } @@ -3946,6 +3947,7 @@ if(IsCompatibleMode(TRK_IMPULSETRACKER)) { pChn->nPanSwing = 0; + pChn->nPanbrelloOffset = 0; } } break; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2015-01-10 18:53:02 UTC (rev 4711) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2015-01-11 17:34:09 UTC (rev 4712) @@ -598,7 +598,8 @@ pChn->rightVol = pChn->newRightVol; pChn->leftVol = pChn->newLeftVol; - pChn->dwFlags.reset(CHN_VIBRATO | CHN_TREMOLO | CHN_PANBRELLO); + pChn->dwFlags.reset(CHN_VIBRATO | CHN_TREMOLO); + if(!IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nPanbrelloOffset = 0; pChn->nCommand = CMD_NONE; pChn->m_plugParamValueStep = 0; } @@ -1174,7 +1175,8 @@ void CSoundFile::ProcessPanbrello(ModChannel *pChn) const //------------------------------------------------------- { - if(pChn->dwFlags[CHN_PANBRELLO]) + int pdelta = pChn->nPanbrelloOffset; + if(pChn->rowCommand.command == CMD_PANBRELLO) { uint32 panpos; // IT compatibility: IT has its own, more precise tables @@ -1183,7 +1185,7 @@ else panpos = ((pChn->nPanbrelloPos + 0x10) >> 2) & 0x3F; - int pdelta = GetVibratoDelta(pChn->nPanbrelloType, panpos); + pdelta = GetVibratoDelta(pChn->nPanbrelloType, panpos); // IT compatibility: Sample-and-hold style random panbrello (tremolo and vibrato don't use this mechanism in IT) // Test case: RandomWaveform.it @@ -1200,12 +1202,18 @@ { pChn->nPanbrelloPos += pChn->nPanbrelloSpeed; } - + // IT compatibility: Panbrello effect is active until next note or panning command. + // Test case: PanbrelloHold.it + if(IsCompatibleMode(TRK_IMPULSETRACKER)) + { + pChn->nPanbrelloOffset = static_cast<int8>(pdelta); + } + } + if(pdelta) + { pdelta = ((pdelta * (int)pChn->nPanbrelloDepth) + 2) >> 3; pdelta += pChn->nRealPan; - pChn->nRealPan = Clamp(pdelta, 0, 256); - //if(IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nPan = pChn->nRealPan; // TODO } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-01-18 00:34:18
|
Revision: 4721 http://sourceforge.net/p/modplug/code/4721 Author: saga-games Date: 2015-01-18 00:34:10 +0000 (Sun, 18 Jan 2015) Log Message: ----------- [Reg] Remove volume column offset from supported IT/XM commands. If possible, they are upgraded to normal offset commands during import (otherwise they stay untouched, but compatibility export will of course discard them as always). [Mod] OpenMPT: Version is now 1.24.01.07 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/soundlib/UpgradeModule.cpp trunk/OpenMPT/soundlib/mod_specifications.cpp trunk/OpenMPT/soundlib/modcommand.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2015-01-15 18:55:03 UTC (rev 4720) +++ trunk/OpenMPT/common/versionNumber.h 2015-01-18 00:34:10 UTC (rev 4721) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 24 #define VER_MINOR 01 -#define VER_MINORMINOR 06 +#define VER_MINORMINOR 07 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/soundlib/UpgradeModule.cpp =================================================================== --- trunk/OpenMPT/soundlib/UpgradeModule.cpp 2015-01-15 18:55:03 UTC (rev 4720) +++ trunk/OpenMPT/soundlib/UpgradeModule.cpp 2015-01-18 00:34:10 UTC (rev 4721) @@ -201,6 +201,14 @@ } } + // Volume column offset in IT/XM is bad, mkay? + if(sndFile.GetType() != MOD_TYPE_MPT && m.volcmd == VOLCMD_OFFSET && m.command == CMD_NONE) + { + m.command = CMD_OFFSET; + m.param = m.vol << 3; + m.volcmd = VOLCMD_NONE; + } + } CSoundFile &sndFile; Modified: trunk/OpenMPT/soundlib/mod_specifications.cpp =================================================================== --- trunk/OpenMPT/soundlib/mod_specifications.cpp 2015-01-15 18:55:03 UTC (rev 4720) +++ trunk/OpenMPT/soundlib/mod_specifications.cpp 2015-01-18 00:34:10 UTC (rev 4721) @@ -196,7 +196,7 @@ 12, // Envelope point count false, // No envelope release node " 0123456789ABCDRFFTE???GHK?YXPLZ\\?#?????", // Supported Effects - " vpcdabuhlrgfe?o", // Supported Volume Column commands + " vpcdabuhlrgfe??", // Supported Volume Column commands false, // Doesn't have "+++" pattern false, // Doesn't have "---" pattern true, // Has restart position (order) @@ -369,7 +369,7 @@ 25, // Envelope point count false, // No envelope release node " JFEGHLKRXODB?CQATI?SMNVW?UY?P?Z\\?#?????", // Supported Effects - " vpcdab?h??gfe?o", // Supported Volume Column commands + " vpcdab?h??gfe??", // Supported Volume Column commands true, // Has "+++" pattern true, // Has "---" pattern false, // Doesn't have restart position (order) Modified: trunk/OpenMPT/soundlib/modcommand.cpp =================================================================== --- trunk/OpenMPT/soundlib/modcommand.cpp 2015-01-15 18:55:03 UTC (rev 4720) +++ trunk/OpenMPT/soundlib/modcommand.cpp 2015-01-18 00:34:10 UTC (rev 4721) @@ -144,6 +144,8 @@ newTypeIsS3M_IT_MPT = (newTypeIsS3M || newTypeIsIT || newTypeIsMPT), newTypeIsIT_MPT = (newTypeIsIT || newTypeIsMPT); + const CModSpecifications &newSpecs = CSoundFile::GetModSpecifications(toType); + ////////////////////////// // Convert 8-bit Panning if(command == CMD_PANNING8) @@ -166,7 +168,7 @@ } // End if(command == CMD_PANNING8) // Re-map \xx to Zxx if the new format only knows the latter command. - if(command == CMD_SMOOTHMIDI && !CSoundFile::GetModSpecifications(toType).HasCommand(CMD_SMOOTHMIDI) && CSoundFile::GetModSpecifications(toType).HasCommand(CMD_MIDI)) + if(command == CMD_SMOOTHMIDI && !newSpecs.HasCommand(CMD_SMOOTHMIDI) && newSpecs.HasCommand(CMD_MIDI)) { command = CMD_MIDI; } @@ -178,10 +180,10 @@ if(IsPcNote()) { COMMAND newCmd = static_cast<COMMAND>(note == NOTE_PC ? CMD_MIDI : CMD_SMOOTHMIDI); - if(!CSoundFile::GetModSpecifications(toType).HasCommand(newCmd)) + if(!newSpecs.HasCommand(newCmd)) { newCmd = CMD_MIDI; // assuming that this was CMD_SMOOTHMIDI - if(!CSoundFile::GetModSpecifications(toType).HasCommand(newCmd)) + if(!newSpecs.HasCommand(newCmd)) { newCmd = CMD_NONE; } @@ -696,14 +698,6 @@ param = vol; volcmd = CMD_NONE; break; - // OpenMPT-specific commands - - case VOLCMD_OFFSET: - command = CMD_OFFSET; - param = vol << 3; - volcmd = CMD_NONE; - break; - } } // End if(newTypeIsS3M) @@ -751,13 +745,6 @@ param = ImpulseTrackerPortaVolCmd[vol & 0x0F]; volcmd = VOLCMD_NONE; break; - - // OpenMPT-specific commands - case VOLCMD_OFFSET: - command = CMD_OFFSET; - param = vol << 3; - volcmd = VOLCMD_NONE; - break; } } // End if(newTypeIsXM) @@ -805,18 +792,26 @@ case VOLCMD_VIBRATODEPTH: // OpenMPT-specific commands case VOLCMD_OFFSET: - vol = MIN(vol, 9); + vol = std::min<PARAM>(vol, 9); break; } } // End if(newTypeIsIT_MPT) - if(!CSoundFile::GetModSpecifications(toType).HasNote(note)) + // Fix volume column offset for formats that don't have it. + if(volcmd == VOLCMD_OFFSET && !newSpecs.HasVolCommand(VOLCMD_OFFSET) && (command == CMD_NONE || !newSpecs.HasCommand(command))) + { + command = CMD_OFFSET; + param = vol << 3; + volcmd = VOLCMD_NONE; + } + + if(!newSpecs.HasNote(note)) note = NOTE_NONE; // ensure the commands really exist in this format - if(!CSoundFile::GetModSpecifications(toType).HasCommand(command)) + if(!newSpecs.HasCommand(command)) command = CMD_NONE; - if(!CSoundFile::GetModSpecifications(toType).HasVolCommand(volcmd)) + if(!newSpecs.HasVolCommand(volcmd)) volcmd = VOLCMD_NONE; } @@ -899,20 +894,20 @@ return true; case CMD_VOLUME: effect = VOLCMD_VOLUME; - param = MIN(param, 64); + param = std::min<PARAM>(param, 64); break; case CMD_PORTAMENTOUP: // if not force, reject when dividing causes loss of data in LSB, or if the final value is too // large to fit. (volume column Ex/Fx are four times stronger than effect column) if(!force && ((param & 3) || param > 9 * 4 + 3)) return false; - param = MIN(param / 4, 9); + param = std::min<PARAM>(param / 4, 9); effect = VOLCMD_PORTAUP; break; case CMD_PORTAMENTODOWN: if(!force && ((param & 3) || param > 9 * 4 + 3)) return false; - param = MIN(param / 4, 9); + param = std::min<PARAM>(param / 4, 9); effect = VOLCMD_PORTADOWN; break; case CMD_TONEPORTAMENTO: @@ -937,7 +932,7 @@ return false; case CMD_VIBRATO: if(force) - param = MIN(param & 0x0F, 9); + param = std::min<PARAM>(param & 0x0F, 9); else if((param & 0x0F) > 9 || (param & 0xF0) != 0) return false; param &= 0x0F; @@ -951,7 +946,7 @@ effect = VOLCMD_VIBRATODEPTH; break; case CMD_PANNING8: - param = MIN(64, param * 64 / 255); + param = std::min<PARAM>(64, param * 64 / 255); effect = VOLCMD_PANNING; break; case CMD_VOLUMESLIDE: @@ -960,7 +955,7 @@ if((param & 0xF) == 0) // Dx0 / Cx { if(force) - param = MIN(param >> 4, 9); + param = std::min<PARAM>(param >> 4, 9); else if((param >> 4) > 9) return false; else @@ -969,14 +964,14 @@ } else if((param & 0xF0) == 0) // D0x / Dx { if(force) - param = MIN(param, 9); + param = std::min<PARAM>(param, 9); else if(param > 9) return false; effect = VOLCMD_VOLSLIDEDOWN; } else if((param & 0xF) == 0xF) // DxF / Ax { if(force) - param = MIN(param >> 4, 9); + param = std::min<PARAM>(param >> 4, 9); else if((param >> 4) > 9) return false; else @@ -985,7 +980,7 @@ } else if((param & 0xf0) == 0xf0) // DFx / Bx { if(force) - param = MIN(param, 9); + param = std::min<PARAM>(param, 9); else if((param & 0xF) > 9) return false; else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-01-18 13:33:59
|
Revision: 4724 http://sourceforge.net/p/modplug/code/4724 Author: manxorist Date: 2015-01-18 13:33:47 +0000 (Sun, 18 Jan 2015) Log Message: ----------- [Ref] libopenmpt: Change makefile configuration filenames from Makefile.config.* to config-*.mk . Modified Paths: -------------- trunk/OpenMPT/Makefile trunk/OpenMPT/README.md trunk/OpenMPT/libopenmpt/dox/changelog.md Added Paths: ----------- trunk/OpenMPT/build/make/config-clang.mk trunk/OpenMPT/build/make/config-defaults.mk trunk/OpenMPT/build/make/config-emscripten.mk trunk/OpenMPT/build/make/config-gcc.mk trunk/OpenMPT/build/make/config-generic.mk trunk/OpenMPT/build/make/config-macosx.mk trunk/OpenMPT/build/make/config-mingw64-win32.mk trunk/OpenMPT/build/make/config-mingw64-win64.mk Removed Paths: ------------- trunk/OpenMPT/build/make/Makefile.config.clang trunk/OpenMPT/build/make/Makefile.config.defaults trunk/OpenMPT/build/make/Makefile.config.emscripten trunk/OpenMPT/build/make/Makefile.config.gcc trunk/OpenMPT/build/make/Makefile.config.generic trunk/OpenMPT/build/make/Makefile.config.macosx trunk/OpenMPT/build/make/Makefile.config.mingw64-win32 trunk/OpenMPT/build/make/Makefile.config.mingw64-win64 Modified: trunk/OpenMPT/Makefile =================================================================== --- trunk/OpenMPT/Makefile 2015-01-18 02:02:03 UTC (rev 4723) +++ trunk/OpenMPT/Makefile 2015-01-18 13:33:47 UTC (rev 4724) @@ -204,11 +204,11 @@ ifeq ($(CONFIG)x,x) -include build/make/Makefile.config.defaults +include build/make/config-defaults.mk else -include build/make/Makefile.config.$(CONFIG) +include build/make/config-$(CONFIG).mk endif Modified: trunk/OpenMPT/README.md =================================================================== --- trunk/OpenMPT/README.md 2015-01-18 02:02:03 UTC (rev 4723) +++ trunk/OpenMPT/README.md 2015-01-18 13:33:47 UTC (rev 4724) @@ -155,12 +155,12 @@ node.js. Version 0.10.25 or greater has been tested. Earlier versions might or might not work. Depending on how your distribution calls the `node.js` binary, you might have to edit - `build/make/Makefile.config.emscripten`. + `build/make/config-emscripten.mk`. The `Makefile` supports some customizations. You might want to read the top which should get you some possible make settings, like e.g. `make DYNLINK=0` or similar. Cross compiling or different compiler would - best be implemented via new `Makefile.config.*` files. + best be implemented via new `config-*.mk` files. The `Makefile` also supports building doxygen documentation by using Deleted: trunk/OpenMPT/build/make/Makefile.config.clang =================================================================== --- trunk/OpenMPT/build/make/Makefile.config.clang 2015-01-18 02:02:03 UTC (rev 4723) +++ trunk/OpenMPT/build/make/Makefile.config.clang 2015-01-18 13:33:47 UTC (rev 4724) @@ -1,17 +0,0 @@ - -CC = clang -CXX = clang++ -LD = clang++ -AR = ar - -CPPFLAGS += -CXXFLAGS += -std=c++0x -fPIC -CFLAGS += -std=c99 -fPIC -LDFLAGS += -LDLIBS += -lm -ARFLAGS := rcs - -CXXFLAGS_WARNINGS += -Wmissing-prototypes -CFLAGS_WARNINGS += -Wmissing-prototypes - -EXESUFFIX= Deleted: trunk/OpenMPT/build/make/Makefile.config.defaults =================================================================== --- trunk/OpenMPT/build/make/Makefile.config.defaults 2015-01-18 02:02:03 UTC (rev 4723) +++ trunk/OpenMPT/build/make/Makefile.config.defaults 2015-01-18 13:33:47 UTC (rev 4724) @@ -1,28 +0,0 @@ - -ifeq ($(HOST),unix) - -ifeq ($(HOST_FLAVOUR),MACOSX) - -include build/make/Makefile.config.clang -# Mac OS X overrides -DYNLINK=0 -# when using iconv -#CPPFLAGS += -DMPT_WITH_ICONV -#LDLIBS += -liconv - -else ifeq ($(HOST_FLAVOUR),LINUX) - -include build/make/Makefile.config.gcc - -else - -include build/make/Makefile.config.generic - -endif - -else - -include build/make/Makefile.config.generic - -endif - Deleted: trunk/OpenMPT/build/make/Makefile.config.emscripten =================================================================== --- trunk/OpenMPT/build/make/Makefile.config.emscripten 2015-01-18 02:02:03 UTC (rev 4723) +++ trunk/OpenMPT/build/make/Makefile.config.emscripten 2015-01-18 13:33:47 UTC (rev 4724) @@ -1,34 +0,0 @@ - -CC = emcc -CXX = em++ -LD = em++ -AR = emar - -CPPFLAGS += -CXXFLAGS += -std=c++0x -fPIC -CFLAGS += -std=c99 -fPIC -LDFLAGS += -O3 -s DISABLE_EXCEPTION_CATCHING=0 -s OUTLINING_LIMIT=16000 -s TOTAL_MEMORY=67108864 -LDLIBS += -ARFLAGS := rcs - -CXXFLAGS_WARNINGS += -Wmissing-prototypes -CFLAGS_WARNINGS += -Wmissing-prototypes - -EXESUFFIX=.js -SOSUFFIX=.js -RUNPREFIX=nodejs -TEST_LDFLAGS= --pre-js build/make/test-pre.js - -DYNLINK=0 -SHARED_LIB=1 -STATIC_LIB=0 -EXAMPLES=1 -OPENMPT123=0 -SHARED_SONAME=0 - -NO_ZLIB=1 -NO_PORTAUDIO=1 -NO_SDL=1 -NO_FLAC=1 -NO_WAVPACK=1 -NO_SNDFILE=1 Deleted: trunk/OpenMPT/build/make/Makefile.config.gcc =================================================================== --- trunk/OpenMPT/build/make/Makefile.config.gcc 2015-01-18 02:02:03 UTC (rev 4723) +++ trunk/OpenMPT/build/make/Makefile.config.gcc 2015-01-18 13:33:47 UTC (rev 4724) @@ -1,24 +0,0 @@ - -CC = gcc -CXX = g++ -LD = g++ -AR = ar - -ifeq ($(ANCIENT),1) -CPPFLAGS += -CXXFLAGS += -std=gnu++98 -fPIC -CFLAGS += -std=c99 -fPIC -LDFLAGS += -LDLIBS += -lm -ARFLAGS := rcs -else -CPPFLAGS += -CXXFLAGS += -std=c++0x -fPIC -CFLAGS += -std=c99 -fPIC -LDFLAGS += -LDLIBS += -lm -ARFLAGS := rcs -endif - -EXESUFFIX= - Deleted: trunk/OpenMPT/build/make/Makefile.config.generic =================================================================== --- trunk/OpenMPT/build/make/Makefile.config.generic 2015-01-18 02:02:03 UTC (rev 4723) +++ trunk/OpenMPT/build/make/Makefile.config.generic 2015-01-18 13:33:47 UTC (rev 4724) @@ -1,19 +0,0 @@ - -CC = cc -CXX = c++ -LD = c++ -AR = ar - -#CPPFLAGS += -DMPT_COMPILER_GENERIC -CXXFLAGS += -std=c++11 -CFLAGS += -std=c99 -LDFLAGS += -LDLIBS += -ARFLAGS := rcs - -MPT_COMPILER_GENERIC=1 -SHARED_LIB=0 -DYNLINK=0 - -EXESUFFIX= - Deleted: trunk/OpenMPT/build/make/Makefile.config.macosx =================================================================== --- trunk/OpenMPT/build/make/Makefile.config.macosx 2015-01-18 02:02:03 UTC (rev 4723) +++ trunk/OpenMPT/build/make/Makefile.config.macosx 2015-01-18 13:33:47 UTC (rev 4724) @@ -1,2 +0,0 @@ - -include Makefile.config.defaults Deleted: trunk/OpenMPT/build/make/Makefile.config.mingw64-win32 =================================================================== --- trunk/OpenMPT/build/make/Makefile.config.mingw64-win32 2015-01-18 02:02:03 UTC (rev 4723) +++ trunk/OpenMPT/build/make/Makefile.config.mingw64-win32 2015-01-18 13:33:47 UTC (rev 4724) @@ -1,24 +0,0 @@ - -CC = i686-w64-mingw32-gcc -CXX = i686-w64-mingw32-g++ -LD = i686-w64-mingw32-g++ -AR = i686-w64-mingw32-ar - -CPPFLAGS += -DWIN32 -D_WIN32 -CXXFLAGS += -std=c++0x -municode -mconsole -CFLAGS += -std=c99 -municode -mconsole -LDFLAGS += -LDLIBS += -lm -lwinmm -ARFLAGS := rcs - -EXESUFFIX=.exe - -DYNLINK=0 -SHARED_LIB=0 -STATIC_LIB=0 - -NO_ZLIB=1 -NO_PORTAUDIO=1 -NO_SNDFILE=1 -NO_FLAC=1 -NO_WAVPACK=1 Deleted: trunk/OpenMPT/build/make/Makefile.config.mingw64-win64 =================================================================== --- trunk/OpenMPT/build/make/Makefile.config.mingw64-win64 2015-01-18 02:02:03 UTC (rev 4723) +++ trunk/OpenMPT/build/make/Makefile.config.mingw64-win64 2015-01-18 13:33:47 UTC (rev 4724) @@ -1,24 +0,0 @@ - -CC = x86_64-w64-mingw32-gcc -CXX = x86_64-w64-mingw32-g++ -LD = x86_64-w64-mingw32-g++ -AR = x86_64-w64-mingw32-ar - -CPPFLAGS += -DWIN32 -D_WIN32 -DWIN64 -D_WIN64 -CXXFLAGS += -std=c++0x -municode -mconsole -CFLAGS += -std=c99 -municode -mconsole -LDFLAGS += -LDLIBS += -lm -lwinmm -ARFLAGS := rcs - -EXESUFFIX=.exe - -DYNLINK=0 -SHARED_LIB=0 -STATIC_LIB=0 - -NO_ZLIB=1 -NO_PORTAUDIO=1 -NO_SNDFILE=1 -NO_FLAC=1 -NO_WAVPACK=1 Copied: trunk/OpenMPT/build/make/config-clang.mk (from rev 4723, trunk/OpenMPT/build/make/Makefile.config.clang) =================================================================== --- trunk/OpenMPT/build/make/config-clang.mk (rev 0) +++ trunk/OpenMPT/build/make/config-clang.mk 2015-01-18 13:33:47 UTC (rev 4724) @@ -0,0 +1,17 @@ + +CC = clang +CXX = clang++ +LD = clang++ +AR = ar + +CPPFLAGS += +CXXFLAGS += -std=c++0x -fPIC +CFLAGS += -std=c99 -fPIC +LDFLAGS += +LDLIBS += -lm +ARFLAGS := rcs + +CXXFLAGS_WARNINGS += -Wmissing-prototypes +CFLAGS_WARNINGS += -Wmissing-prototypes + +EXESUFFIX= Copied: trunk/OpenMPT/build/make/config-defaults.mk (from rev 4723, trunk/OpenMPT/build/make/Makefile.config.defaults) =================================================================== --- trunk/OpenMPT/build/make/config-defaults.mk (rev 0) +++ trunk/OpenMPT/build/make/config-defaults.mk 2015-01-18 13:33:47 UTC (rev 4724) @@ -0,0 +1,28 @@ + +ifeq ($(HOST),unix) + +ifeq ($(HOST_FLAVOUR),MACOSX) + +include build/make/config-clang.mk +# Mac OS X overrides +DYNLINK=0 +# when using iconv +#CPPFLAGS += -DMPT_WITH_ICONV +#LDLIBS += -liconv + +else ifeq ($(HOST_FLAVOUR),LINUX) + +include build/make/config-gcc.mk + +else + +include build/make/config-generic.mk + +endif + +else + +include build/make/config-generic.mk + +endif + Copied: trunk/OpenMPT/build/make/config-emscripten.mk (from rev 4723, trunk/OpenMPT/build/make/Makefile.config.emscripten) =================================================================== --- trunk/OpenMPT/build/make/config-emscripten.mk (rev 0) +++ trunk/OpenMPT/build/make/config-emscripten.mk 2015-01-18 13:33:47 UTC (rev 4724) @@ -0,0 +1,34 @@ + +CC = emcc +CXX = em++ +LD = em++ +AR = emar + +CPPFLAGS += +CXXFLAGS += -std=c++0x -fPIC +CFLAGS += -std=c99 -fPIC +LDFLAGS += -O3 -s DISABLE_EXCEPTION_CATCHING=0 -s OUTLINING_LIMIT=16000 -s TOTAL_MEMORY=67108864 +LDLIBS += +ARFLAGS := rcs + +CXXFLAGS_WARNINGS += -Wmissing-prototypes +CFLAGS_WARNINGS += -Wmissing-prototypes + +EXESUFFIX=.js +SOSUFFIX=.js +RUNPREFIX=nodejs +TEST_LDFLAGS= --pre-js build/make/test-pre.js + +DYNLINK=0 +SHARED_LIB=1 +STATIC_LIB=0 +EXAMPLES=1 +OPENMPT123=0 +SHARED_SONAME=0 + +NO_ZLIB=1 +NO_PORTAUDIO=1 +NO_SDL=1 +NO_FLAC=1 +NO_WAVPACK=1 +NO_SNDFILE=1 Copied: trunk/OpenMPT/build/make/config-gcc.mk (from rev 4723, trunk/OpenMPT/build/make/Makefile.config.gcc) =================================================================== --- trunk/OpenMPT/build/make/config-gcc.mk (rev 0) +++ trunk/OpenMPT/build/make/config-gcc.mk 2015-01-18 13:33:47 UTC (rev 4724) @@ -0,0 +1,24 @@ + +CC = gcc +CXX = g++ +LD = g++ +AR = ar + +ifeq ($(ANCIENT),1) +CPPFLAGS += +CXXFLAGS += -std=gnu++98 -fPIC +CFLAGS += -std=c99 -fPIC +LDFLAGS += +LDLIBS += -lm +ARFLAGS := rcs +else +CPPFLAGS += +CXXFLAGS += -std=c++0x -fPIC +CFLAGS += -std=c99 -fPIC +LDFLAGS += +LDLIBS += -lm +ARFLAGS := rcs +endif + +EXESUFFIX= + Copied: trunk/OpenMPT/build/make/config-generic.mk (from rev 4723, trunk/OpenMPT/build/make/Makefile.config.generic) =================================================================== --- trunk/OpenMPT/build/make/config-generic.mk (rev 0) +++ trunk/OpenMPT/build/make/config-generic.mk 2015-01-18 13:33:47 UTC (rev 4724) @@ -0,0 +1,19 @@ + +CC = cc +CXX = c++ +LD = c++ +AR = ar + +#CPPFLAGS += -DMPT_COMPILER_GENERIC +CXXFLAGS += -std=c++11 +CFLAGS += -std=c99 +LDFLAGS += +LDLIBS += +ARFLAGS := rcs + +MPT_COMPILER_GENERIC=1 +SHARED_LIB=0 +DYNLINK=0 + +EXESUFFIX= + Copied: trunk/OpenMPT/build/make/config-macosx.mk (from rev 4723, trunk/OpenMPT/build/make/Makefile.config.macosx) =================================================================== --- trunk/OpenMPT/build/make/config-macosx.mk (rev 0) +++ trunk/OpenMPT/build/make/config-macosx.mk 2015-01-18 13:33:47 UTC (rev 4724) @@ -0,0 +1,2 @@ + +include config-defaults.mk Copied: trunk/OpenMPT/build/make/config-mingw64-win32.mk (from rev 4723, trunk/OpenMPT/build/make/Makefile.config.mingw64-win32) =================================================================== --- trunk/OpenMPT/build/make/config-mingw64-win32.mk (rev 0) +++ trunk/OpenMPT/build/make/config-mingw64-win32.mk 2015-01-18 13:33:47 UTC (rev 4724) @@ -0,0 +1,24 @@ + +CC = i686-w64-mingw32-gcc +CXX = i686-w64-mingw32-g++ +LD = i686-w64-mingw32-g++ +AR = i686-w64-mingw32-ar + +CPPFLAGS += -DWIN32 -D_WIN32 +CXXFLAGS += -std=c++0x -municode -mconsole +CFLAGS += -std=c99 -municode -mconsole +LDFLAGS += +LDLIBS += -lm -lwinmm +ARFLAGS := rcs + +EXESUFFIX=.exe + +DYNLINK=0 +SHARED_LIB=0 +STATIC_LIB=0 + +NO_ZLIB=1 +NO_PORTAUDIO=1 +NO_SNDFILE=1 +NO_FLAC=1 +NO_WAVPACK=1 Copied: trunk/OpenMPT/build/make/config-mingw64-win64.mk (from rev 4723, trunk/OpenMPT/build/make/Makefile.config.mingw64-win64) =================================================================== --- trunk/OpenMPT/build/make/config-mingw64-win64.mk (rev 0) +++ trunk/OpenMPT/build/make/config-mingw64-win64.mk 2015-01-18 13:33:47 UTC (rev 4724) @@ -0,0 +1,24 @@ + +CC = x86_64-w64-mingw32-gcc +CXX = x86_64-w64-mingw32-g++ +LD = x86_64-w64-mingw32-g++ +AR = x86_64-w64-mingw32-ar + +CPPFLAGS += -DWIN32 -D_WIN32 -DWIN64 -D_WIN64 +CXXFLAGS += -std=c++0x -municode -mconsole +CFLAGS += -std=c99 -municode -mconsole +LDFLAGS += +LDLIBS += -lm -lwinmm +ARFLAGS := rcs + +EXESUFFIX=.exe + +DYNLINK=0 +SHARED_LIB=0 +STATIC_LIB=0 + +NO_ZLIB=1 +NO_PORTAUDIO=1 +NO_SNDFILE=1 +NO_FLAC=1 +NO_WAVPACK=1 Modified: trunk/OpenMPT/libopenmpt/dox/changelog.md =================================================================== --- trunk/OpenMPT/libopenmpt/dox/changelog.md 2015-01-18 02:02:03 UTC (rev 4723) +++ trunk/OpenMPT/libopenmpt/dox/changelog.md 2015-01-18 13:33:47 UTC (rev 4724) @@ -7,6 +7,9 @@ ### libopenmpt-svn + * Makefile configuration filenames changed from + `build/make/Makefile.config.*` to `build/make/config-*.mk`. + * Vibrato effect was too weak in beta8 and beta9 in IT linear slide mode. * Tiny IT playback compatibility improvements. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2015-01-21 18:57:00
|
Revision: 4726 http://sourceforge.net/p/modplug/code/4726 Author: saga-games Date: 2015-01-21 18:56:51 +0000 (Wed, 21 Jan 2015) Log Message: ----------- [Fix] MOD playback: To match ProTracker, the portamento target is no longer reset when a new note is encountered (like in FT2), but it is reset when the target is reached (like in IT). Fixes nuhanenatanssi.mod. [Mod] OpenMPT: Version is now 1.24.01.08 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2015-01-19 16:20:41 UTC (rev 4725) +++ trunk/OpenMPT/common/versionNumber.h 2015-01-21 18:56:51 UTC (rev 4726) @@ -19,7 +19,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 24 #define VER_MINOR 01 -#define VER_MINORMINOR 07 +#define VER_MINORMINOR 08 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-01-19 16:20:41 UTC (rev 4725) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2015-01-21 18:56:51 UTC (rev 4726) @@ -704,10 +704,9 @@ if(forbiddenCommands[p->command]) { stopNote = true; - } - // Special case: Slides using extended commands - if(p->command == CMD_MODCMDEX) + } else if(p->command == CMD_MODCMDEX) { + // Special case: Slides using extended commands switch(p->param & 0xF0) { case 0x10: @@ -1175,7 +1174,9 @@ // FT2 compatibility: Don't reset portamento target with new instrument numbers. // Test case: Porta-Pickup.xm - if(!IsCompatibleMode(TRK_FASTTRACKER2)) + // ProTracker does the same. + // Test case: PortaTarget.mod + if(!IsCompatibleMode(TRK_FASTTRACKER2) && GetType() != MOD_TYPE_MOD) { pChn->nPortamentoDest = 0; } @@ -1335,9 +1336,11 @@ { // FT2 compatibility: Don't reset portamento target with new notes. // Test case: Porta-Pickup.xm + // ProTracker does the same. + // Test case: PortaTarget.mod // IT compatibility: Portamento target is completely cleared with new notes. // Test case: PortaReset.it - if(bPorta || !(IsCompatibleMode(TRK_FASTTRACKER2) || IsCompatibleMode(TRK_IMPULSETRACKER))) + if(bPorta || !(IsCompatibleMode(TRK_FASTTRACKER2) || IsCompatibleMode(TRK_IMPULSETRACKER) || GetType() == MOD_TYPE_MOD)) { pChn->nPortamentoDest = period; } @@ -3425,8 +3428,10 @@ } } - //IT compatibility 23. Portamento with no note - if(pChn->nPeriod == pChn->nPortamentoDest && IsCompatibleMode(TRK_IMPULSETRACKER)) + // IT compatibility 23. Portamento with no note + // ProTracker also disables portamento once the target is reached. + // Test case: PortaTarget.mod + if(pChn->nPeriod == pChn->nPortamentoDest && (IsCompatibleMode(TRK_IMPULSETRACKER) || GetType() == MOD_TYPE_MOD)) pChn->nPortamentoDest = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-01-22 11:49:19
|
Revision: 4727 http://sourceforge.net/p/modplug/code/4727 Author: manxorist Date: 2015-01-22 11:49:05 +0000 (Thu, 22 Jan 2015) Log Message: ----------- [Var] build: Rename libopenmpt/examples/ to examples/ in order to make 'make install' consistent between simple makefile and autotools tarballs. Automake does not support an easy way to influence the install path (it can do either with full path or no path at all). Two other possible solutions would have been to write a custom install rule (which results in all the portability stuff to be handled on our site instead of having automake do it's work) or use recursive automake (which would open another whole can of worms on its own). Just renaming the folder is the most simple solution with the least risk of more maintanance work in the future. (fixes https://bugs.openmpt.org/view.php?id=624) Modified Paths: -------------- trunk/OpenMPT/Makefile trunk/OpenMPT/build/autotools/Makefile.am trunk/OpenMPT/build/autotools/autoconfiscate.sh trunk/OpenMPT/build/svn/run_clang-format.sh trunk/OpenMPT/build/vs2008/libopenmpt_example_c/libopenmpt_example_c.vcproj trunk/OpenMPT/libopenmpt/Doxyfile Added Paths: ----------- trunk/OpenMPT/examples/ Removed Paths: ------------- trunk/OpenMPT/libopenmpt/examples/ Modified: trunk/OpenMPT/Makefile =================================================================== --- trunk/OpenMPT/Makefile 2015-01-21 18:56:51 UTC (rev 4726) +++ trunk/OpenMPT/Makefile 2015-01-22 11:49:05 UTC (rev 4727) @@ -494,8 +494,8 @@ ALL_DEPENDS += $(LIBOPENMPTTEST_DEPENDS) -EXAMPLES_CXX_SOURCES += $(wildcard libopenmpt/examples/*.cpp) -EXAMPLES_C_SOURCES += $(wildcard libopenmpt/examples/*.c) +EXAMPLES_CXX_SOURCES += $(wildcard examples/*.cpp) +EXAMPLES_C_SOURCES += $(wildcard examples/*.c) EXAMPLES_OBJECTS += $(EXAMPLES_CXX_SOURCES:.cpp=.o) EXAMPLES_OBJECTS += $(EXAMPLES_C_SOURCES:.c=.o) @@ -668,10 +668,10 @@ $(INSTALL_DATA) README.md $(DESTDIR)$(PREFIX)/share/doc/libopenmpt/README.md $(INSTALL_DATA) TODO $(DESTDIR)$(PREFIX)/share/doc/libopenmpt/TODO $(INSTALL_MAKE_DIR) $(DESTDIR)$(PREFIX)/share/doc/libopenmpt/examples - $(INSTALL_DATA) libopenmpt/examples/libopenmpt_example_c.c $(DESTDIR)$(PREFIX)/share/doc/libopenmpt/examples/libopenmpt_example_c.c - $(INSTALL_DATA) libopenmpt/examples/libopenmpt_example_c_mem.c $(DESTDIR)$(PREFIX)/share/doc/libopenmpt/examples/libopenmpt_example_c_mem.c - $(INSTALL_DATA) libopenmpt/examples/libopenmpt_example_c_stdout.c $(DESTDIR)$(PREFIX)/share/doc/libopenmpt/examples/libopenmpt_example_c_stdout.c - $(INSTALL_DATA) libopenmpt/examples/libopenmpt_example_cxx.cpp $(DESTDIR)$(PREFIX)/share/doc/libopenmpt/examples/libopenmpt_example_cxx.cpp + $(INSTALL_DATA) examples/libopenmpt_example_c.c $(DESTDIR)$(PREFIX)/share/doc/libopenmpt/examples/libopenmpt_example_c.c + $(INSTALL_DATA) examples/libopenmpt_example_c_mem.c $(DESTDIR)$(PREFIX)/share/doc/libopenmpt/examples/libopenmpt_example_c_mem.c + $(INSTALL_DATA) examples/libopenmpt_example_c_stdout.c $(DESTDIR)$(PREFIX)/share/doc/libopenmpt/examples/libopenmpt_example_c_stdout.c + $(INSTALL_DATA) examples/libopenmpt_example_cxx.cpp $(DESTDIR)$(PREFIX)/share/doc/libopenmpt/examples/libopenmpt_example_cxx.cpp .PHONY: install-doc install-doc: bin/made.docs @@ -770,6 +770,7 @@ svn export ./soundlib bin/dist-tar/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/soundlib svn export ./test bin/dist-tar/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/test svn export ./libopenmpt bin/dist-tar/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/libopenmpt + svn export ./examples bin/dist-tar/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/examples svn export ./openmpt123 bin/dist-tar/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/openmpt123 svn export ./include/miniz bin/dist-tar/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/include/miniz svn export ./include/modplug bin/dist-tar/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/include/modplug @@ -793,6 +794,7 @@ svn export ./soundlib bin/dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/soundlib --native-eol CRLF svn export ./test bin/dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/test --native-eol CRLF svn export ./libopenmpt bin/dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/libopenmpt --native-eol CRLF + svn export ./examples bin/dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/examples --native-eol CRLF svn export ./openmpt123 bin/dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/openmpt123 --native-eol CRLF svn export ./include/miniz bin/dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/include/miniz --native-eol CRLF svn export ./include/flac bin/dist-zip/libopenmpt-$(DIST_LIBOPENMPT_VERSION)/include/flac --native-eol CRLF @@ -848,53 +850,53 @@ $(SILENT)$(LINK.cc) $(LDFLAGS_RPATH) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_OPENMPT123) $(OPENMPT123_OBJECTS) $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_OPENMPT123) -o $@ endif -libopenmpt/examples/libopenmpt_example_c.o: libopenmpt/examples/libopenmpt_example_c.c +examples/libopenmpt_example_c.o: examples/libopenmpt_example_c.c $(INFO) [CC] $< $(VERYSILENT)$(CC) $(CFLAGS) $(CFLAGS_PORTAUDIO) $(CPPFLAGS) $(CPPFLAGS_PORTAUDIO) $(TARGET_ARCH) -M -MT$@ $< > $*.d $(SILENT)$(COMPILE.c) $(CFLAGS_PORTAUDIO) $(CPPFLAGS_PORTAUDIO) $(OUTPUT_OPTION) $< -libopenmpt/examples/libopenmpt_example_c_mem.o: libopenmpt/examples/libopenmpt_example_c_mem.c +examples/libopenmpt_example_c_mem.o: examples/libopenmpt_example_c_mem.c $(INFO) [CC] $< $(VERYSILENT)$(CC) $(CFLAGS) $(CFLAGS_PORTAUDIO) $(CPPFLAGS) $(CPPFLAGS_PORTAUDIO) $(TARGET_ARCH) -M -MT$@ $< > $*.d $(SILENT)$(COMPILE.c) $(CFLAGS_PORTAUDIO) $(CPPFLAGS_PORTAUDIO) $(OUTPUT_OPTION) $< -libopenmpt/examples/libopenmpt_example_c_stdout.o: libopenmpt/examples/libopenmpt_example_c_stdout.c +examples/libopenmpt_example_c_stdout.o: examples/libopenmpt_example_c_stdout.c $(INFO) [CC] $< $(VERYSILENT)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -M -MT$@ $< > $*.d $(SILENT)$(COMPILE.c) $(OUTPUT_OPTION) $< -libopenmpt/examples/libopenmpt_example_cxx.o: libopenmpt/examples/libopenmpt_example_cxx.cpp +examples/libopenmpt_example_cxx.o: examples/libopenmpt_example_cxx.cpp $(INFO) [CXX] $< $(VERYSILENT)$(CXX) $(CXXFLAGS) $(CXXFLAGS_PORTAUDIO) $(CPPFLAGS) $(CPPFLAGS_PORTAUDIO) $(TARGET_ARCH) -M -MT$@ $< > $*.d $(SILENT)$(COMPILE.cc) $(CXXFLAGS_PORTAUDIO) $(CPPFLAGS_PORTAUDIO) $(OUTPUT_OPTION) $< -bin/libopenmpt_example_c$(EXESUFFIX): libopenmpt/examples/libopenmpt_example_c.o $(OBJECTS_LIBOPENMPT) $(OUTPUT_LIBOPENMPT) +bin/libopenmpt_example_c$(EXESUFFIX): examples/libopenmpt_example_c.o $(OBJECTS_LIBOPENMPT) $(OUTPUT_LIBOPENMPT) $(INFO) [LD] $@ - $(SILENT)$(LINK.cc) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) libopenmpt/examples/libopenmpt_example_c.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ + $(SILENT)$(LINK.cc) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) examples/libopenmpt_example_c.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ ifeq ($(HOST),unix) $(SILENT)mv $@ $@.norpath $(INFO) [LD] $@ - $(SILENT)$(LINK.cc) $(LDFLAGS_RPATH) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) libopenmpt/examples/libopenmpt_example_c.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ + $(SILENT)$(LINK.cc) $(LDFLAGS_RPATH) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) examples/libopenmpt_example_c.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ endif -bin/libopenmpt_example_c_mem$(EXESUFFIX): libopenmpt/examples/libopenmpt_example_c_mem.o $(OBJECTS_LIBOPENMPT) $(OUTPUT_LIBOPENMPT) +bin/libopenmpt_example_c_mem$(EXESUFFIX): examples/libopenmpt_example_c_mem.o $(OBJECTS_LIBOPENMPT) $(OUTPUT_LIBOPENMPT) $(INFO) [LD] $@ - $(SILENT)$(LINK.cc) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) libopenmpt/examples/libopenmpt_example_c_mem.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ + $(SILENT)$(LINK.cc) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) examples/libopenmpt_example_c_mem.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ ifeq ($(HOST),unix) $(SILENT)mv $@ $@.norpath $(INFO) [LD] $@ - $(SILENT)$(LINK.cc) $(LDFLAGS_RPATH) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) libopenmpt/examples/libopenmpt_example_c_mem.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ + $(SILENT)$(LINK.cc) $(LDFLAGS_RPATH) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) examples/libopenmpt_example_c_mem.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ endif -bin/libopenmpt_example_c_stdout$(EXESUFFIX): libopenmpt/examples/libopenmpt_example_c_stdout.o $(OBJECTS_LIBOPENMPT) $(OUTPUT_LIBOPENMPT) +bin/libopenmpt_example_c_stdout$(EXESUFFIX): examples/libopenmpt_example_c_stdout.o $(OBJECTS_LIBOPENMPT) $(OUTPUT_LIBOPENMPT) $(INFO) [LD] $@ - $(SILENT)$(LINK.cc) $(LDFLAGS_LIBOPENMPT) libopenmpt/examples/libopenmpt_example_c_stdout.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) -o $@ + $(SILENT)$(LINK.cc) $(LDFLAGS_LIBOPENMPT) examples/libopenmpt_example_c_stdout.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) -o $@ ifeq ($(HOST),unix) $(SILENT)mv $@ $@.norpath $(INFO) [LD] $@ - $(SILENT)$(LINK.cc) $(LDFLAGS_RPATH) $(LDFLAGS_LIBOPENMPT) libopenmpt/examples/libopenmpt_example_c_stdout.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) -o $@ + $(SILENT)$(LINK.cc) $(LDFLAGS_RPATH) $(LDFLAGS_LIBOPENMPT) examples/libopenmpt_example_c_stdout.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) -o $@ endif -bin/libopenmpt_example_cxx$(EXESUFFIX): libopenmpt/examples/libopenmpt_example_cxx.o $(OBJECTS_LIBOPENMPT) $(OUTPUT_LIBOPENMPT) +bin/libopenmpt_example_cxx$(EXESUFFIX): examples/libopenmpt_example_cxx.o $(OBJECTS_LIBOPENMPT) $(OUTPUT_LIBOPENMPT) $(INFO) [LD] $@ - $(SILENT)$(LINK.cc) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) libopenmpt/examples/libopenmpt_example_cxx.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ + $(SILENT)$(LINK.cc) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) examples/libopenmpt_example_cxx.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ ifeq ($(HOST),unix) $(SILENT)mv $@ $@.norpath $(INFO) [LD] $@ - $(SILENT)$(LINK.cc) $(LDFLAGS_RPATH) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) libopenmpt/examples/libopenmpt_example_cxx.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ + $(SILENT)$(LINK.cc) $(LDFLAGS_RPATH) $(LDFLAGS_LIBOPENMPT) $(LDFLAGS_PORTAUDIO) examples/libopenmpt_example_cxx.o $(OBJECTS_LIBOPENMPT) $(LOADLIBES) $(LDLIBS) $(LDLIBS_LIBOPENMPT) $(LDLIBS_PORTAUDIO) -o $@ endif .PHONY: clean Modified: trunk/OpenMPT/build/autotools/Makefile.am =================================================================== --- trunk/OpenMPT/build/autotools/Makefile.am 2015-01-21 18:56:51 UTC (rev 4726) +++ trunk/OpenMPT/build/autotools/Makefile.am 2015-01-22 11:49:05 UTC (rev 4727) @@ -16,16 +16,18 @@ EXTRA_DIST += test/test.s3m EXTRA_DIST += test/test.mptm EXTRA_DIST += man/openmpt123.1 +EXTRA_DIST += examples/.clang-format MOSTLYCLEANFILES = dist_doc_DATA = dist_doc_DATA += LICENSE dist_doc_DATA += README.md dist_doc_DATA += TODO -dist_doc_DATA += libopenmpt/examples/libopenmpt_example_cxx.cpp -dist_doc_DATA += libopenmpt/examples/libopenmpt_example_c_mem.c -dist_doc_DATA += libopenmpt/examples/libopenmpt_example_c.c -dist_doc_DATA += libopenmpt/examples/libopenmpt_example_c_stdout.c +nobase_dist_doc_DATA = +nobase_dist_doc_DATA += examples/libopenmpt_example_cxx.cpp +nobase_dist_doc_DATA += examples/libopenmpt_example_c_mem.c +nobase_dist_doc_DATA += examples/libopenmpt_example_c.c +nobase_dist_doc_DATA += examples/libopenmpt_example_c_stdout.c bin_PROGRAMS = check_PROGRAMS = @@ -39,11 +41,11 @@ check_PROGRAMS += libopenmpt_example_cxx endif -libopenmpt_example_c_stdout_SOURCES = libopenmpt/examples/libopenmpt_example_c_stdout.c +libopenmpt_example_c_stdout_SOURCES = examples/libopenmpt_example_c_stdout.c if HAVE_PORTAUDIO -libopenmpt_example_c_SOURCES = libopenmpt/examples/libopenmpt_example_c.c -libopenmpt_example_c_mem_SOURCES = libopenmpt/examples/libopenmpt_example_c_mem.c -libopenmpt_example_cxx_SOURCES = libopenmpt/examples/libopenmpt_example_cxx.cpp +libopenmpt_example_c_SOURCES = examples/libopenmpt_example_c.c +libopenmpt_example_c_mem_SOURCES = examples/libopenmpt_example_c_mem.c +libopenmpt_example_cxx_SOURCES = examples/libopenmpt_example_cxx.cpp endif libopenmpt_example_c_stdout_CPPFLAGS = Modified: trunk/OpenMPT/build/autotools/autoconfiscate.sh =================================================================== --- trunk/OpenMPT/build/autotools/autoconfiscate.sh 2015-01-21 18:56:51 UTC (rev 4726) +++ trunk/OpenMPT/build/autotools/autoconfiscate.sh 2015-01-22 11:49:05 UTC (rev 4727) @@ -32,6 +32,7 @@ svn export ./soundlib bin/dist-autotools/soundlib svn export ./test bin/dist-autotools/test svn export ./libopenmpt bin/dist-autotools/libopenmpt +svn export ./examples bin/dist-autotools/examples mkdir bin/dist-autotools/src svn export ./openmpt123 bin/dist-autotools/src/openmpt123 #svn export ./openmpt123 bin/dist-autotools/openmpt123 Modified: trunk/OpenMPT/build/svn/run_clang-format.sh =================================================================== --- trunk/OpenMPT/build/svn/run_clang-format.sh 2015-01-21 18:56:51 UTC (rev 4726) +++ trunk/OpenMPT/build/svn/run_clang-format.sh 2015-01-22 11:49:05 UTC (rev 4727) @@ -5,6 +5,6 @@ # clang-format-3.5 -i *.h *.c *.hpp *.cpp #cd .. -cd libopenmpt/examples +cd examples clang-format-3.5 -i *.c *.cpp -cd ../.. +cd .. Modified: trunk/OpenMPT/build/vs2008/libopenmpt_example_c/libopenmpt_example_c.vcproj =================================================================== --- trunk/OpenMPT/build/vs2008/libopenmpt_example_c/libopenmpt_example_c.vcproj 2015-01-21 18:56:51 UTC (rev 4726) +++ trunk/OpenMPT/build/vs2008/libopenmpt_example_c/libopenmpt_example_c.vcproj 2015-01-22 11:49:05 UTC (rev 4727) @@ -161,7 +161,7 @@ </References> <Files> <File - RelativePath="..\..\..\libopenmpt\examples\libopenmpt_example_c.c" + RelativePath="..\..\..\examples\libopenmpt_example_c.c" > </File> </Files> Modified: trunk/OpenMPT/libopenmpt/Doxyfile =================================================================== --- trunk/OpenMPT/libopenmpt/Doxyfile 2015-01-21 18:56:51 UTC (rev 4726) +++ trunk/OpenMPT/libopenmpt/Doxyfile 2015-01-22 11:49:05 UTC (rev 4727) @@ -825,7 +825,7 @@ # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = libopenmpt/examples/ LICENSE +EXAMPLE_PATH = examples/ LICENSE # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2015-01-29 10:35:59
|
Revision: 4734 http://sourceforge.net/p/modplug/code/4734 Author: manxorist Date: 2015-01-29 10:35:45 +0000 (Thu, 29 Jan 2015) Log Message: ----------- [Imp] build: Add CHECKED build option to libopenmpt makefile which allows using llvm sanitizers (use with CHECKED_ADDRESS=1 or CHECKED_UNDEFINED=1). Define MPT_BUILD_CHECKED macro when built this way. Modified Paths: -------------- trunk/OpenMPT/Makefile trunk/OpenMPT/build/make/config-clang.mk Modified: trunk/OpenMPT/Makefile =================================================================== --- trunk/OpenMPT/Makefile 2015-01-24 18:04:15 UTC (rev 4733) +++ trunk/OpenMPT/Makefile 2015-01-29 10:35:45 UTC (rev 4734) @@ -133,7 +133,11 @@ SOSUFFIX=.so OPENMPT123=1 +CHECKED=0 +CHECKED_ADDRESS=0 +CHECKED_UNDEFINED=0 + # get commandline or defaults CPPFLAGS := $(CPPFLAGS) @@ -241,6 +245,12 @@ endif endif +ifeq ($(CHECKED),1) +CPPFLAGS += -DMPT_BUILD_CHECKED +CXXFLAGS += -g +CFLAGS += -g +endif + CXXFLAGS += -W CFLAGS += -W @@ -268,6 +278,12 @@ endif endif +ifeq ($(CHECKED),1) +CPPFLAGS += -DMPT_BUILD_CHECKED +CXXFLAGS += -g +CFLAGS += -g +endif + CXXFLAGS += -Wall -Wextra -Wcast-align $(CXXFLAGS_WARNINGS) CFLAGS += -Wall -Wextra -Wcast-align $(CFLAGS_WARNINGS) Modified: trunk/OpenMPT/build/make/config-clang.mk =================================================================== --- trunk/OpenMPT/build/make/config-clang.mk 2015-01-24 18:04:15 UTC (rev 4733) +++ trunk/OpenMPT/build/make/config-clang.mk 2015-01-29 10:35:45 UTC (rev 4734) @@ -14,4 +14,14 @@ CXXFLAGS_WARNINGS += -Wmissing-prototypes CFLAGS_WARNINGS += -Wmissing-prototypes +ifeq ($(CHECKED_ADDRESS),1) +CXXFLAGS += -fsanitize=address +CFLAGS += -fsanitize=address +endif + +ifeq ($(CHECKED_UNDEFINED),1) +CXXFLAGS += -fsanitize=undefined +CFLAGS += -fsanitize=undefined +endif + EXESUFFIX= This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |