[Scummvm-cvs-logs] SF.net SVN: scummvm:[47007] scummvm/trunk/engines/sci
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Tue Jan 5 02:22:17 CET 2010
Revision: 47007
http://scummvm.svn.sourceforge.net/scummvm/?rev=47007&view=rev
Author: thebluegr
Date: 2010-01-05 01:22:16 +0000 (Tue, 05 Jan 2010)
Log Message:
-----------
Renamed /gui to /graphics and /sfx to /sound, to better illustrate their purpose
Modified Paths:
--------------
scummvm/trunk/engines/sci/console.cpp
scummvm/trunk/engines/sci/engine/game.cpp
scummvm/trunk/engines/sci/engine/kernel32.cpp
scummvm/trunk/engines/sci/engine/kevent.cpp
scummvm/trunk/engines/sci/engine/kgraphics.cpp
scummvm/trunk/engines/sci/engine/kmenu.cpp
scummvm/trunk/engines/sci/engine/kmisc.cpp
scummvm/trunk/engines/sci/engine/kmovement.cpp
scummvm/trunk/engines/sci/engine/kpathing.cpp
scummvm/trunk/engines/sci/engine/ksound.cpp
scummvm/trunk/engines/sci/engine/savegame.cpp
scummvm/trunk/engines/sci/engine/state.h
scummvm/trunk/engines/sci/graphics/gui.cpp
scummvm/trunk/engines/sci/graphics/gui.h
scummvm/trunk/engines/sci/graphics/gui_animate.cpp
scummvm/trunk/engines/sci/graphics/gui_animate.h
scummvm/trunk/engines/sci/graphics/gui_controls.cpp
scummvm/trunk/engines/sci/graphics/gui_cursor.cpp
scummvm/trunk/engines/sci/graphics/gui_font.cpp
scummvm/trunk/engines/sci/graphics/gui_font.h
scummvm/trunk/engines/sci/graphics/gui_gfx.cpp
scummvm/trunk/engines/sci/graphics/gui_gfx.h
scummvm/trunk/engines/sci/graphics/gui_menu.cpp
scummvm/trunk/engines/sci/graphics/gui_palette.cpp
scummvm/trunk/engines/sci/graphics/gui_palette.h
scummvm/trunk/engines/sci/graphics/gui_picture.cpp
scummvm/trunk/engines/sci/graphics/gui_portrait.cpp
scummvm/trunk/engines/sci/graphics/gui_screen.cpp
scummvm/trunk/engines/sci/graphics/gui_screen.h
scummvm/trunk/engines/sci/graphics/gui_text.cpp
scummvm/trunk/engines/sci/graphics/gui_transitions.cpp
scummvm/trunk/engines/sci/graphics/gui_transitions.h
scummvm/trunk/engines/sci/graphics/gui_view.cpp
scummvm/trunk/engines/sci/graphics/gui_windowmgr.cpp
scummvm/trunk/engines/sci/module.mk
scummvm/trunk/engines/sci/resource.h
scummvm/trunk/engines/sci/sci.cpp
scummvm/trunk/engines/sci/sound/audio.cpp
scummvm/trunk/engines/sci/sound/iterator/core.cpp
scummvm/trunk/engines/sci/sound/iterator/core.h
scummvm/trunk/engines/sci/sound/iterator/iterator.cpp
scummvm/trunk/engines/sci/sound/iterator/iterator.h
scummvm/trunk/engines/sci/sound/iterator/iterator_internal.h
scummvm/trunk/engines/sci/sound/iterator/songlib.cpp
scummvm/trunk/engines/sci/sound/music.cpp
scummvm/trunk/engines/sci/sound/music.h
scummvm/trunk/engines/sci/sound/seq/gm.cpp
scummvm/trunk/engines/sci/sound/seq/instrument-map.cpp
scummvm/trunk/engines/sci/sound/seq/instrument-map.h
scummvm/trunk/engines/sci/sound/seq/map-mt32-to-gm.cpp
scummvm/trunk/engines/sci/sound/softseq/adlib.cpp
scummvm/trunk/engines/sci/sound/softseq/amiga.cpp
scummvm/trunk/engines/sci/sound/softseq/pcjr.cpp
scummvm/trunk/engines/sci/sound/softseq/pcjr.h
scummvm/trunk/engines/sci/sound/soundcmd.cpp
Added Paths:
-----------
scummvm/trunk/engines/sci/graphics/
scummvm/trunk/engines/sci/sound/
scummvm/trunk/engines/sci/sound/midiparser_sci.cpp
scummvm/trunk/engines/sci/sound/midiparser_sci.h
Removed Paths:
-------------
scummvm/trunk/engines/sci/gui/
scummvm/trunk/engines/sci/sfx/
scummvm/trunk/engines/sci/sound/midiparser.cpp
scummvm/trunk/engines/sci/sound/midiparser.h
Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/console.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -36,15 +36,15 @@
#include "sci/engine/gc.h"
#include "sci/engine/kernel_types.h" // for determine_reg_type
#ifdef USE_OLD_MUSIC_FUNCTIONS
-#include "sci/sfx/iterator/songlib.h" // for SongLibrary
-#include "sci/sfx/iterator/iterator.h" // for SCI_SONG_ITERATOR_TYPE_SCI0
+#include "sci/sound/iterator/songlib.h" // for SongLibrary
+#include "sci/sound/iterator/iterator.h" // for SCI_SONG_ITERATOR_TYPE_SCI0
#else
-#include "sci/sfx/music.h"
+#include "sci/sound/music.h"
#endif
-#include "sci/sfx/softseq/mididriver.h"
+#include "sci/sound/softseq/mididriver.h"
#include "sci/vocabulary.h"
-#include "sci/gui/gui.h"
-#include "sci/gui/gui_cursor.h"
+#include "sci/graphics/gui.h"
+#include "sci/graphics/gui_cursor.h"
#include "graphics/video/avi_decoder.h"
#include "sci/video/seq_decoder.h"
Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/engine/game.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -34,8 +34,8 @@
#include "sci/engine/kernel.h"
#include "sci/engine/kernel_types.h"
#include "sci/engine/message.h"
-#include "sci/gui/gui.h"
-#include "sci/sfx/music.h"
+#include "sci/graphics/gui.h"
+#include "sci/sound/music.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/engine/kernel32.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel32.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/engine/kernel32.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -28,7 +28,7 @@
#include "sci/engine/kernel.h"
#include "sci/engine/segment.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui.h"
+#include "sci/graphics/gui.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/engine/kevent.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kevent.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/engine/kevent.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -29,8 +29,8 @@
#include "sci/console.h"
#include "sci/debug.h" // for g_debug_simulated_key
#include "sci/event.h"
-#include "sci/gui/gui.h"
-#include "sci/gui/gui_cursor.h"
+#include "sci/graphics/gui.h"
+#include "sci/graphics/gui_cursor.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -33,11 +33,11 @@
#include "sci/video/seq_decoder.h"
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
-#include "sci/gui/gui.h"
-#include "sci/gui/gui_animate.h"
-#include "sci/gui/gui_cursor.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_view.h"
+#include "sci/graphics/gui.h"
+#include "sci/graphics/gui_animate.h"
+#include "sci/graphics/gui_cursor.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_view.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/engine/kmenu.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmenu.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/engine/kmenu.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -27,8 +27,8 @@
#include "sci/resource.h"
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
-#include "sci/gui/gui.h"
-#include "sci/gui/gui_cursor.h"
+#include "sci/graphics/gui.h"
+#include "sci/graphics/gui_cursor.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/engine/kmisc.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmisc.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/engine/kmisc.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -31,7 +31,7 @@
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
#include "sci/engine/gc.h"
-#include "sci/gui/gui.h"
+#include "sci/graphics/gui.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/engine/kmovement.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmovement.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/engine/kmovement.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -27,7 +27,7 @@
#include "sci/resource.h"
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
-#include "sci/gui/gui_animate.h"
+#include "sci/graphics/gui_animate.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,7 +26,7 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
-#include "sci/gui/gui.h"
+#include "sci/graphics/gui.h"
#include "common/list.h"
Modified: scummvm/trunk/engines/sci/engine/ksound.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/ksound.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/engine/ksound.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -25,7 +25,7 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/sfx/soundcmd.h"
+#include "sci/sound/soundcmd.h"
#include "sci/engine/kernel.h"
#include "sci/engine/vm.h" // for Object
Modified: scummvm/trunk/engines/sci/engine/savegame.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/savegame.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/engine/savegame.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -36,13 +36,13 @@
#include "sci/engine/message.h"
#include "sci/engine/savegame.h"
#include "sci/engine/vm_types.h"
-#include "sci/gui/gui.h"
-#include "sci/sfx/audio.h"
+#include "sci/graphics/gui.h"
+#include "sci/sound/audio.h"
#ifdef USE_OLD_MUSIC_FUNCTIONS
-#include "sci/sfx/iterator/core.h"
-#include "sci/sfx/iterator/iterator.h"
+#include "sci/sound/iterator/core.h"
+#include "sci/sound/iterator/iterator.h"
#else
-#include "sci/sfx/music.h"
+#include "sci/sound/music.h"
#endif
namespace Sci {
Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/engine/state.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -41,11 +41,11 @@
#include "sci/engine/kernel.h" // for kfunct_sig_pair_t
#include "sci/engine/script.h"
#include "sci/engine/seg_manager.h"
-#include "sci/sfx/audio.h"
+#include "sci/sound/audio.h"
#ifdef USE_OLD_MUSIC_FUNCTIONS
-#include "sci/sfx/iterator/core.h"
+#include "sci/sound/iterator/core.h"
#endif
-#include "sci/sfx/soundcmd.h"
+#include "sci/sound/soundcmd.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -30,18 +30,18 @@
#include "sci/debug.h" // for g_debug_sleeptime_factor
#include "sci/event.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_palette.h"
-#include "sci/gui/gui_cursor.h"
-#include "sci/gui/gui_gfx.h"
-#include "sci/gui/gui_windowmgr.h"
-#include "sci/gui/gui_animate.h"
-#include "sci/gui/gui_controls.h"
-#include "sci/gui/gui_menu.h"
-#include "sci/gui/gui_text.h"
-#include "sci/gui/gui_transitions.h"
-#include "sci/gui/gui_view.h"
+#include "sci/graphics/gui.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_palette.h"
+#include "sci/graphics/gui_cursor.h"
+#include "sci/graphics/gui_gfx.h"
+#include "sci/graphics/gui_windowmgr.h"
+#include "sci/graphics/gui_animate.h"
+#include "sci/graphics/gui_controls.h"
+#include "sci/graphics/gui_menu.h"
+#include "sci/graphics/gui_text.h"
+#include "sci/graphics/gui_transitions.h"
+#include "sci/graphics/gui_view.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,7 +26,7 @@
#ifndef SCI_GUI_GUI_H
#define SCI_GUI_GUI_H
-#include "sci/gui/gui_helpers.h"
+#include "sci/graphics/gui_helpers.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_animate.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_animate.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -30,11 +30,11 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
#include "sci/engine/vm.h"
-#include "sci/gui/gui_gfx.h"
-#include "sci/gui/gui_view.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_transitions.h"
-#include "sci/gui/gui_animate.h"
+#include "sci/graphics/gui_gfx.h"
+#include "sci/graphics/gui_view.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_transitions.h"
+#include "sci/graphics/gui_animate.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_animate.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_animate.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_animate.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,7 +26,7 @@
#ifndef SCI_GUI_ANIMATE_H
#define SCI_GUI_ANIMATE_H
-#include "sci/gui/gui_helpers.h"
+#include "sci/graphics/gui_helpers.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_controls.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_controls.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_controls.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -30,10 +30,10 @@
#include "sci/sci.h"
#include "sci/event.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_gfx.h"
-#include "sci/gui/gui_font.h"
-#include "sci/gui/gui_text.h"
-#include "sci/gui/gui_controls.h"
+#include "sci/graphics/gui_gfx.h"
+#include "sci/graphics/gui_font.h"
+#include "sci/graphics/gui_text.h"
+#include "sci/graphics/gui_controls.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_cursor.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_cursor.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_cursor.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -29,10 +29,10 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_palette.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_view.h"
-#include "sci/gui/gui_cursor.h"
+#include "sci/graphics/gui_palette.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_view.h"
+#include "sci/graphics/gui_cursor.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_font.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_font.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_font.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -25,8 +25,8 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_font.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_font.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_font.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_font.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_font.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,7 +26,7 @@
#ifndef SCI_GUI_FONT_H
#define SCI_GUI_FONT_H
-#include "sci/gui/gui_helpers.h"
+#include "sci/graphics/gui_helpers.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_gfx.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -29,14 +29,14 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_gfx.h"
-#include "sci/gui/gui_animate.h"
-#include "sci/gui/gui_font.h"
-#include "sci/gui/gui_picture.h"
-#include "sci/gui/gui_view.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_palette.h"
-#include "sci/gui/gui_text.h"
+#include "sci/graphics/gui_gfx.h"
+#include "sci/graphics/gui_animate.h"
+#include "sci/graphics/gui_font.h"
+#include "sci/graphics/gui_picture.h"
+#include "sci/graphics/gui_view.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_palette.h"
+#include "sci/graphics/gui_text.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_gfx.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_gfx.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_gfx.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,7 +26,7 @@
#ifndef SCI_GUI_GFX_H
#define SCI_GUI_GFX_H
-#include "sci/gui/gui.h"
+#include "sci/graphics/gui.h"
#include "common/hashmap.h"
Modified: scummvm/trunk/engines/sci/graphics/gui_menu.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_menu.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_menu.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -30,13 +30,13 @@
#include "sci/sci.h"
#include "sci/event.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_helpers.h"
-#include "sci/gui/gui_gfx.h"
-#include "sci/gui/gui_cursor.h"
-#include "sci/gui/gui_font.h"
-#include "sci/gui/gui_text.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_menu.h"
+#include "sci/graphics/gui_helpers.h"
+#include "sci/graphics/gui_gfx.h"
+#include "sci/graphics/gui_cursor.h"
+#include "sci/graphics/gui_font.h"
+#include "sci/graphics/gui_text.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_menu.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_palette.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_palette.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_palette.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -28,8 +28,8 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_palette.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_palette.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_palette.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_palette.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_palette.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,7 +26,7 @@
#ifndef SCI_GUI_PALETTE_H
#define SCI_GUI_PALETTE_H
-#include "sci/gui/gui_helpers.h"
+#include "sci/graphics/gui_helpers.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_picture.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_picture.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_picture.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,10 +26,10 @@
#include "common/stack.h"
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_palette.h"
-#include "sci/gui/gui_gfx.h"
-#include "sci/gui/gui_picture.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_palette.h"
+#include "sci/graphics/gui_gfx.h"
+#include "sci/graphics/gui_picture.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_portrait.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_portrait.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_portrait.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -29,9 +29,9 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_palette.h"
-#include "sci/gui/gui_portrait.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_palette.h"
+#include "sci/graphics/gui_portrait.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_screen.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_screen.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -29,7 +29,7 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_screen.h"
+#include "sci/graphics/gui_screen.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_screen.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_screen.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_screen.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -27,7 +27,7 @@
#define SCI_GUI_SCREEN_H
#include "sci/sci.h"
-#include "sci/gui/gui_helpers.h"
+#include "sci/graphics/gui_helpers.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_text.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_text.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_text.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -29,9 +29,9 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_gfx.h"
-#include "sci/gui/gui_font.h"
-#include "sci/gui/gui_text.h"
+#include "sci/graphics/gui_gfx.h"
+#include "sci/graphics/gui_font.h"
+#include "sci/graphics/gui_text.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_transitions.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_transitions.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_transitions.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -30,10 +30,10 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_palette.h"
-#include "sci/gui/gui_transitions.h"
+#include "sci/graphics/gui.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_palette.h"
+#include "sci/graphics/gui_transitions.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_transitions.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_transitions.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_transitions.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,7 +26,7 @@
#ifndef SCI_GUI_TRANSITIONS_H
#define SCI_GUI_TRANSITIONS_H
-#include "sci/gui/gui_helpers.h"
+#include "sci/graphics/gui_helpers.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_view.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_view.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_view.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -25,10 +25,10 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_gfx.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_palette.h"
-#include "sci/gui/gui_view.h"
+#include "sci/graphics/gui_gfx.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_palette.h"
+#include "sci/graphics/gui_view.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/graphics/gui_windowmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_windowmgr.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/graphics/gui_windowmgr.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -27,11 +27,11 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/gui/gui_screen.h"
-#include "sci/gui/gui_gfx.h"
-#include "sci/gui/gui_animate.h"
-#include "sci/gui/gui_text.h"
-#include "sci/gui/gui_windowmgr.h"
+#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/gui_gfx.h"
+#include "sci/graphics/gui_animate.h"
+#include "sci/graphics/gui_text.h"
+#include "sci/graphics/gui_windowmgr.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/module.mk
===================================================================
--- scummvm/trunk/engines/sci/module.mk 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/module.mk 2010-01-05 01:22:16 UTC (rev 47007)
@@ -35,34 +35,34 @@
engine/static_selectors.o \
engine/state.o \
engine/vm.o \
- gui/gui.o \
- gui/gui_animate.o \
- gui/gui_controls.o \
- gui/gui_cursor.o \
- gui/gui_font.o \
- gui/gui_gfx.o \
- gui/gui_menu.o \
- gui/gui_palette.o \
- gui/gui_picture.o \
- gui/gui_portrait.o \
- gui/gui_screen.o \
- gui/gui_text.o \
- gui/gui_transitions.o \
- gui/gui_view.o \
- gui/gui_windowmgr.o \
- sfx/audio.o \
- sfx/midiparser.o \
- sfx/music.o \
- sfx/soundcmd.o \
- sfx/iterator/core.o \
- sfx/iterator/iterator.o \
- sfx/iterator/songlib.o \
- sfx/seq/gm.o \
- sfx/seq/instrument-map.o \
- sfx/seq/map-mt32-to-gm.o \
- sfx/softseq/adlib.o \
- sfx/softseq/amiga.o \
- sfx/softseq/pcjr.o \
+ graphics/gui.o \
+ graphics/gui_animate.o \
+ graphics/gui_controls.o \
+ graphics/gui_cursor.o \
+ graphics/gui_font.o \
+ graphics/gui_gfx.o \
+ graphics/gui_menu.o \
+ graphics/gui_palette.o \
+ graphics/gui_picture.o \
+ graphics/gui_portrait.o \
+ graphics/gui_screen.o \
+ graphics/gui_text.o \
+ graphics/gui_transitions.o \
+ graphics/gui_view.o \
+ graphics/gui_windowmgr.o \
+ sound/audio.o \
+ sound/midiparser.o \
+ sound/music.o \
+ sound/soundcmd.o \
+ sound/iterator/core.o \
+ sound/iterator/iterator.o \
+ sound/iterator/songlib.o \
+ sound/seq/gm.o \
+ sound/seq/instrument-map.o \
+ sound/seq/map-mt32-to-gm.o \
+ sound/softseq/adlib.o \
+ sound/softseq/amiga.o \
+ sound/softseq/pcjr.o \
video/seq_decoder.o \
video/vmd_decoder.o
Modified: scummvm/trunk/engines/sci/resource.h
===================================================================
--- scummvm/trunk/engines/sci/resource.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/resource.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -34,7 +34,7 @@
#include "sound/audiostream.h"
#include "sound/mixer.h" // for SoundHandle
-#include "gui/gui_helpers.h" // for ViewType
+#include "graphics/gui_helpers.h" // for ViewType
#include "sci/decompressor.h"
#include "sci/sci.h"
Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sci.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -36,12 +36,12 @@
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
-#include "sci/sfx/audio.h"
-#include "sci/sfx/soundcmd.h"
-#include "sci/gui/gui.h"
-#include "sci/gui/gui_palette.h"
-#include "sci/gui/gui_cursor.h"
-#include "sci/gui/gui_screen.h"
+#include "sci/sound/audio.h"
+#include "sci/sound/soundcmd.h"
+#include "sci/graphics/gui.h"
+#include "sci/graphics/gui_palette.h"
+#include "sci/graphics/gui_cursor.h"
+#include "sci/graphics/gui_screen.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/sound/audio.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/audio.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/audio.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,7 +26,7 @@
#include "sci/resource.h"
#include "sci/engine/kernel.h"
#include "sci/engine/seg_manager.h"
-#include "sci/sfx/audio.h"
+#include "sci/sound/audio.h"
#include "common/system.h"
Modified: scummvm/trunk/engines/sci/sound/iterator/core.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator/core.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/iterator/core.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -28,11 +28,11 @@
#include "sci/sci.h"
#ifdef USE_OLD_MUSIC_FUNCTIONS
-#include "sci/sfx/iterator/core.h"
-#include "sci/sfx/iterator/iterator.h"
-#include "sci/sfx/softseq/mididriver.h"
+#include "sci/sound/iterator/core.h"
+#include "sci/sound/iterator/iterator.h"
+#include "sci/sound/softseq/mididriver.h"
-#include "sci/sfx/softseq/pcjr.h"
+#include "sci/sound/softseq/pcjr.h"
#include "common/system.h"
#include "common/timer.h"
Modified: scummvm/trunk/engines/sci/sound/iterator/core.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator/core.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/iterator/core.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -32,7 +32,7 @@
#include "sci/sci.h" // for USE_OLD_MUSIC_FUNCTIONS
#ifdef USE_OLD_MUSIC_FUNCTIONS
-#include "sci/sfx/iterator/songlib.h"
+#include "sci/sound/iterator/songlib.h"
#include "sci/resource.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/sound/iterator/iterator.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator/iterator.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/iterator/iterator.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -30,9 +30,9 @@
#include "sci/sci.h"
#ifdef USE_OLD_MUSIC_FUNCTIONS
-#include "sci/sfx/iterator/iterator_internal.h"
+#include "sci/sound/iterator/iterator_internal.h"
#include "sci/engine/state.h" // for sfx_player_tell_synth :/
-#include "sci/sfx/iterator/core.h" // for sfx_player_tell_synth
+#include "sci/sound/iterator/core.h" // for sfx_player_tell_synth
#include "sound/audiostream.h"
#include "sound/mixer.h"
Modified: scummvm/trunk/engines/sci/sound/iterator/iterator.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator/iterator.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/iterator/iterator.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -31,7 +31,7 @@
#include "sci/sci.h" // for USE_OLD_MUSIC_FUNCTIONS
#ifdef USE_OLD_MUSIC_FUNCTIONS
-#include "sci/sfx/softseq/mididriver.h"
+#include "sci/sound/softseq/mididriver.h"
namespace Audio {
class AudioStream;
Modified: scummvm/trunk/engines/sci/sound/iterator/iterator_internal.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator/iterator_internal.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/iterator/iterator_internal.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -29,8 +29,8 @@
#include "sci/sci.h" // for USE_OLD_MUSIC_FUNCTIONS
#ifdef USE_OLD_MUSIC_FUNCTIONS
-#include "sci/sfx/iterator/iterator.h"
-#include "sci/sfx/softseq/mididriver.h"
+#include "sci/sound/iterator/iterator.h"
+#include "sci/sound/softseq/mididriver.h"
#include "common/array.h"
#include "common/list.h"
Modified: scummvm/trunk/engines/sci/sound/iterator/songlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator/songlib.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/iterator/songlib.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,8 +26,8 @@
#include "sci/sci.h" // for USE_OLD_MUSIC_FUNCTIONS
#ifdef USE_OLD_MUSIC_FUNCTIONS
-#include "sci/sfx/iterator/core.h"
-#include "sci/sfx/iterator/iterator.h"
+#include "sci/sound/iterator/core.h"
+#include "sci/sound/iterator/iterator.h"
namespace Sci {
Deleted: scummvm/trunk/engines/sci/sound/midiparser.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/midiparser.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/midiparser.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -1,506 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "sci/engine/kernel.h"
-#include "sci/engine/state.h"
-#include "sci/sfx/midiparser.h"
-#include "sci/sfx/softseq/mididriver.h"
-
-namespace Sci {
-
-static const int nMidiParams[] = { 2, 2, 2, 2, 1, 1, 2, 0 };
-
-enum SciMidiCommands {
- kSetSignalLoop = 0x7F,
- kEndOfTrack = 0xFC,
- kSetReverb = 0x50,
- kMidiHold = 0x52,
- kUpdateCue = 0x60
-};
-
-// MidiParser_SCI
-//
-MidiParser_SCI::MidiParser_SCI(SciVersion soundVersion) :
- MidiParser() {
- _soundVersion = soundVersion;
- _mixedData = NULL;
- // mididata contains delta in 1/60th second
- // values of ppqn and tempo are found experimentally and may be wrong
- _ppqn = 1;
- setTempo(16667);
-
- _volume = 0;
-
- _signalSet = false;
- _signalToSet = 0;
-}
-
-MidiParser_SCI::~MidiParser_SCI() {
- unloadMusic();
-}
-
-bool MidiParser_SCI::loadMusic(SoundResource::Track *track, MusicEntry *psnd, int channelFilterMask, SciVersion soundVersion) {
- unloadMusic();
- _track = track;
- _pSnd = psnd;
- _soundVersion = soundVersion;
-
- setVolume(psnd->volume);
-
- if (channelFilterMask) {
- // SCI0 only has 1 data stream, but we need to filter out channels depending on music hardware selection
- midiFilterChannels(channelFilterMask);
- } else {
- midiMixChannels();
- }
-
- _num_tracks = 1;
- _tracks[0] = _mixedData;
- setTrack(0);
- _loopTick = 0;
- return true;
-}
-
-void MidiParser_SCI::unloadMusic() {
- allNotesOff();
- resetTracking();
- _num_tracks = 0;
- if (_mixedData) {
- delete[] _mixedData;
- _mixedData = NULL;
- }
-}
-
-void MidiParser_SCI::parseNextEvent(EventInfo &info) {
- // Set signal AFTER waiting for delta, otherwise we would set signal too soon resulting in all sorts of bugs
- if (_signalSet) {
- _signalSet = false;
- _pSnd->signal = _signalToSet;
- debugC(2, kDebugLevelSound, "signal %04x", _signalToSet);
- }
-
- info.start = _position._play_pos;
- info.delta = 0;
- while (*_position._play_pos == 0xF8) {
- info.delta += 240;
- _position._play_pos++;
- }
- info.delta += *(_position._play_pos++);
-
- // Process the next info.
- if ((_position._play_pos[0] & 0xF0) >= 0x80)
- info.event = *(_position._play_pos++);
- else
- info.event = _position._running_status;
- if (info.event < 0x80)
- return;
-
- _position._running_status = info.event;
- switch (info.command()) {
- case 0xC:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = 0;
- if (info.channel() == 0xF) {// SCI special case
- if (info.basic.param1 != kSetSignalLoop) {
- _signalSet = true;
- _signalToSet = info.basic.param1;
- } else {
- _loopTick = _position._play_tick;
- }
- }
- break;
- case 0xD:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = 0;
- break;
-
- case 0xB:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
- if (info.channel() == 0xF) {// SCI special
- // Reference for some events:
- // http://wiki.scummvm.org/index.php/SCI/Specifications/Sound/SCI0_Resource_Format#Status_Reference
- // Also, sci/sfx/iterator/iterator.cpp, function BaseSongIterator::parseMidiCommand()
- switch (info.basic.param1) {
- case kSetReverb:
- // TODO: Not implemented yet
- break;
- case kMidiHold:
- // Check if the hold ID marker is the same as the hold ID
- // marker set for that song by cmdSetSoundHold.
- // If it is, loop back, but don't stop notes when jumping.
- if (info.basic.param2 == _pSnd->hold)
- jumpToTick(_loopTick, false, false);
- break;
- case kUpdateCue:
- switch (_soundVersion) {
- case SCI_VERSION_0_EARLY:
- case SCI_VERSION_0_LATE:
- _pSnd->dataInc += info.basic.param2;
- _signalSet = true;
- _signalToSet = 0x7f + _pSnd->dataInc;
- break;
- case SCI_VERSION_1_EARLY:
- case SCI_VERSION_1_LATE:
- _pSnd->dataInc++;
- break;
- default:
- break;
- }
- break;
- // Unhandled SCI commands
- case 0x46: // LSL3 - binoculars
- case 0x61: // Iceman (Adlib?)
- case 0x73: // Hoyle
- case 0xd1: // KQ4, when riding the unicorn
- // Obscure SCI commands - ignored
- break;
- // Standard MIDI commands
- case 0x01: // mod wheel
- case 0x04: // foot controller
- case 0x07: // channel volume
- case 0x0A: // pan
- case 0x0B: // expression
- case 0x40: // sustain
- case 0x4E: // velocity control
- case 0x79: // reset all
- case 0x7B: // notes off
- // These are all handled by the music driver, so ignore them
- break;
- case 0x4B: // voice mapping
- // TODO: is any support for this needed at the MIDI parser level?
- warning("Unhanded SCI MIDI command 0x%x - voice mapping (parameter %d)", info.basic.param1, info.basic.param2);
- break;
- default:
- warning("Unhandled SCI MIDI command 0x%x (parameter %d)", info.basic.param1, info.basic.param2);
- break;
- }
- }
- if (info.basic.param1 == 7) // channel volume change -scale it
- info.basic.param2 = info.basic.param2 * _volume / 0x7F;
- info.length = 0;
- break;
-
- case 0x8:
- case 0x9:
- case 0xA:
- case 0xE:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
- if (info.command() == 0x9 && info.basic.param2 == 0)
- info.event = info.channel() | 0x80;
- info.length = 0;
- break;
-
- case 0xF: // System Common, Meta or SysEx event
- switch (info.event & 0x0F) {
- case 0x2: // Song Position Pointer
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
- break;
-
- case 0x3: // Song Select
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = 0;
- break;
-
- case 0x6:
- case 0x8:
- case 0xA:
- case 0xB:
- case 0xC:
- case 0xE:
- info.basic.param1 = info.basic.param2 = 0;
- break;
-
- case 0x0: // SysEx
- info.length = readVLQ(_position._play_pos);
- info.ext.data = _position._play_pos;
- _position._play_pos += info.length;
- break;
-
- case 0xF: // META event
- info.ext.type = *(_position._play_pos++);
- info.length = readVLQ(_position._play_pos);
- info.ext.data = _position._play_pos;
- _position._play_pos += info.length;
- if (info.ext.type == 0x2F) {// end of track reached
- if (_pSnd->loop)
- _pSnd->loop--;
- if (_pSnd->loop) {
- // We need to play it again...
- jumpToTick(_loopTick);
- } else {
- _pSnd->status = kSoundStopped;
- _pSnd->signal = SIGNAL_OFFSET;
-
- debugC(2, kDebugLevelSound, "signal EOT");
- }
- }
- break;
- default:
- warning(
- "MidiParser_SCI::parseNextEvent: Unsupported event code %x",
- info.event);
- } // // System Common, Meta or SysEx event
- }// switch (info.command())
-}
-
-
-byte MidiParser_SCI::midiGetNextChannel(long ticker) {
- byte curr = 0xFF;
- long closest = ticker + 1000000, next = 0;
-
- for (int i = 0; i < _track->channelCount; i++) {
- if (_track->channels[i].time == -1) // channel ended
- continue;
- next = *_track->channels[i].data; // when the next event shoudl occur
- if (next == 0xF8) // 0xF8 means 240 ticks delay
- next = 240;
- next += _track->channels[i].time;
- if (next < closest) {
- curr = i;
- closest = next;
- }
- }
-
- return curr;
-}
-
-byte *MidiParser_SCI::midiMixChannels() {
- int totalSize = 0;
- byte **dataPtr = new byte *[_track->channelCount];
-
- for (int i = 0; i < _track->channelCount; i++) {
- dataPtr[i] = _track->channels[i].data;
- _track->channels[i].time = 0;
- _track->channels[i].prev = 0;
- totalSize += _track->channels[i].size;
- }
-
- byte *mixedData = new byte[totalSize * 2]; // FIXME: creates overhead and still may be not enough to hold all data
- _mixedData = mixedData;
- long ticker = 0;
- byte curr, delta;
- byte cmd, par1, global_prev = 0;
- long new_delta;
- SoundResource::Channel *channel;
- while ((curr = midiGetNextChannel(ticker)) != 0xFF) { // there is still active channel
- channel = &_track->channels[curr];
- delta = *channel->data++;
- channel->time += (delta == 0xF8 ? 240 : delta); // when the comamnd is supposed to occur
- if (delta == 0xF8)
- continue;
- new_delta = channel->time - ticker;
- ticker += new_delta;
-
- cmd = *channel->data++;
- if (cmd != kEndOfTrack) {
- // output new delta
- while (new_delta > 240) {
- *mixedData++ = 0xF8;
- new_delta -= 240;
- }
- *mixedData++ = (byte)new_delta;
- }
- switch (cmd) {
- case 0xF0: // sysEx
- *mixedData++ = cmd;
- do {
- par1 = *channel->data++;
- *mixedData++ = par1; // out
- } while (par1 != 0xF7);
- break;
- case kEndOfTrack: // end channel
- channel->time = -1; // FIXME
- break;
- default: // MIDI command
- if (cmd & 0x80)
- par1 = *channel->data++;
- else {// running status
- par1 = cmd;
- cmd = channel->prev;
- }
- if (cmd != global_prev)
- *mixedData++ = cmd; // out cmd
- *mixedData++ = par1;// pout par1
- if (nMidiParams[(cmd >> 4) - 8] == 2)
- *mixedData++ = *channel->data++; // out par2
- channel->prev = cmd;
- global_prev = cmd;
- }// switch(cmd)
- }// while (curr)
- // mixing finished. inserting stop event
- *mixedData++ = 0;
- *mixedData++ = 0xFF;
- *mixedData++ = 0x2F;
- *mixedData++ = 0x00;
- *mixedData++ = 0x00;
-
- for (int channelNr = 0; channelNr < _track->channelCount; channelNr++)
- _track->channels[channelNr].data = dataPtr[channelNr];
-
- delete[] dataPtr;
- return _mixedData;
-}
-
-// This is used for SCI0 sound-data. SCI0 only has one stream that may
-// contain several channels and according to output device we remove
-// certain channels from that data.
-byte *MidiParser_SCI::midiFilterChannels(int channelMask) {
- SoundResource::Channel *channel = &_track->channels[0];
- byte *channelData = channel->data;
- byte *channelDataEnd = channel->data + channel->size;
- byte *filterData = new byte[channel->size + 5];
- byte curChannel, curByte, curDelta;
- byte command, lastCommand;
- int delta = 0;
- //int dataLeft = channel->size;
- int midiParamCount;
-
- _mixedData = filterData;
- command = 0;
- midiParamCount = 0;
- lastCommand = 0;
- curChannel = 15;
-
- while (channelData < channelDataEnd) {
- curDelta = *channelData++;
- if (curDelta == 0xF8) {
- delta += 240;
- continue;
- }
- delta += curDelta;
- curByte = *channelData++;
-
- switch (curByte) {
- case 0xF0: // sysEx
- case kEndOfTrack: // end of channel
- command = curByte;
- curChannel = 15;
- break;
- default:
- if (curByte & 0x80) {
- command = curByte;
- curChannel = command & 0x0F;
- midiParamCount = nMidiParams[(command >> 4) - 8];
- }
- }
- if ((1 << curChannel) & channelMask) {
- if (command != kEndOfTrack) {
- debugC(2, kDebugLevelSound, "\nDELTA ");
- // Write delta
- while (delta > 240) {
- *filterData++ = 0xF8;
- debugC(2, kDebugLevelSound, "F8 ");
- delta -= 240;
- }
- *filterData++ = (byte)delta;
- debugC(2, kDebugLevelSound, "%02X ", delta);
- delta = 0;
- }
- // Write command
- switch (command) {
- case 0xF0: // sysEx
- *filterData++ = command;
- debugC(2, kDebugLevelSound, "%02X ", command);
- do {
- curByte = *channelData++;
- *filterData++ = curByte; // out
- } while (curByte != 0xF7);
- lastCommand = command;
- break;
-
- case kEndOfTrack: // end of channel
- break;
-
- default: // MIDI command
- if (lastCommand != command) {
- *filterData++ = command;
- debugC(2, kDebugLevelSound, "%02X ", command);
- lastCommand = command;
- }
- if (midiParamCount > 0) {
- if (curByte & 0x80) {
- debugC(2, kDebugLevelSound, "%02X ", *channelData);
- *filterData++ = *channelData++;
- } else {
- debugC(2, kDebugLevelSound, "%02X ", curByte);
- *filterData++ = curByte;
- }
- }
- if (midiParamCount > 1) {
- debugC(2, kDebugLevelSound, "%02X ", *channelData);
- *filterData++ = *channelData++;
- }
- }
- } else {
- if (curByte & 0x80) {
- channelData += midiParamCount;
- } else {
- channelData += midiParamCount - 1;
- }
- }
- }
- // Stop event
- *filterData++ = 0; // delta
- *filterData++ = 0xFF; // Meta-Event
- *filterData++ = 0x2F; // End-Of-Track
- *filterData++ = 0x00;
- *filterData++ = 0x00;
-
- return _mixedData;
-}
-
-void MidiParser_SCI::setVolume(byte bVolume) {
- if (bVolume > 0x7F)
- bVolume = 0x7F;
- if (_volume != bVolume) {
- _volume = bVolume;
-
- switch (_soundVersion) {
- case SCI_VERSION_0_EARLY:
- case SCI_VERSION_0_LATE: {
- MidiPlayer *SCIDriver = (MidiPlayer *)_driver;
- int16 globalVolume = _volume * 15 / 127;
- SCIDriver->setVolume(globalVolume);
- break;
- }
-
- case SCI_VERSION_1_EARLY:
- case SCI_VERSION_1_LATE:
- // sending volume change to all active channels
- for (int i = 0; i < _track->channelCount; i++)
- if (_track->channels[i].number <= 0xF)
- _driver->send(0xB0 + _track->channels[i].number, 7, _volume);
- break;
-
- default:
- error("MidiParser_SCI::setVolume: Unsupported soundVersion");
- }
- }
-}
-
-} // End of namespace Sci
Deleted: scummvm/trunk/engines/sci/sound/midiparser.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/midiparser.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/midiparser.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -1,85 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef SCI_MIDIPARSER_H
-#define SCI_MIDIPARSER_H
-
-#include "sci/resource.h"
-#include "sci/sfx/music.h"
-#include "sound/midiparser.h"
-
-/*
- Sound drivers info: (from driver cmd0)
- Adlib/SB : track 0 , voices 9 , patch 3 ah=1
- ProAudioSp: track 0 , voices 9 , patch 3 ah=17
- GenerlMIDI: track 7 , voices 32, patch 4 ah=1 SCI1.1
- Game Blast: track 9 , voices 12, patch 101 ah=1
- MT-32 : track 12, voices 32, patch 1 ah=1
- PC Speaker: track 18, voices 1 , patch 0xFF ah=1
- Tandy : track 19, voices 3 , patch 101 ah=1
- IBM PS/1 : track 19, voices 3 , patch 101 ah=1
-
- */
-
-namespace Sci {
-
-class MidiParser_SCI : public MidiParser {
-public:
- MidiParser_SCI(SciVersion soundVersion);
- ~MidiParser_SCI();
- bool loadMusic(SoundResource::Track *track, MusicEntry *psnd, int channelFilterMask, SciVersion soundVersion);
- bool loadMusic(byte *, uint32) {
- return false;
- }
- void unloadMusic();
- void setVolume(byte bVolume);
- void stop() {
- _abort_parse = true;
- allNotesOff();
- }
- void pause() {
- allNotesOff();
- }
-
-protected:
- void parseNextEvent(EventInfo &info);
- byte *midiMixChannels();
- byte *midiFilterChannels(int channelMask);
- byte midiGetNextChannel(long ticker);
-
- SciVersion _soundVersion;
- byte *_mixedData;
- SoundResource::Track *_track;
- MusicEntry *_pSnd;
- uint32 _loopTick;
- byte _volume;
-
- bool _signalSet;
- int16 _signalToSet;
-};
-
-} // End of namespace Sci
-
-#endif
Copied: scummvm/trunk/engines/sci/sound/midiparser_sci.cpp (from rev 47006, scummvm/trunk/engines/sci/sfx/midiparser.cpp)
===================================================================
--- scummvm/trunk/engines/sci/sound/midiparser_sci.cpp (rev 0)
+++ scummvm/trunk/engines/sci/sound/midiparser_sci.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -0,0 +1,506 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "sci/engine/kernel.h"
+#include "sci/engine/state.h"
+#include "sci/sound/midiparser_sci.h"
+#include "sci/sound/softseq/mididriver.h"
+
+namespace Sci {
+
+static const int nMidiParams[] = { 2, 2, 2, 2, 1, 1, 2, 0 };
+
+enum SciMidiCommands {
+ kSetSignalLoop = 0x7F,
+ kEndOfTrack = 0xFC,
+ kSetReverb = 0x50,
+ kMidiHold = 0x52,
+ kUpdateCue = 0x60
+};
+
+// MidiParser_SCI
+//
+MidiParser_SCI::MidiParser_SCI(SciVersion soundVersion) :
+ MidiParser() {
+ _soundVersion = soundVersion;
+ _mixedData = NULL;
+ // mididata contains delta in 1/60th second
+ // values of ppqn and tempo are found experimentally and may be wrong
+ _ppqn = 1;
+ setTempo(16667);
+
+ _volume = 0;
+
+ _signalSet = false;
+ _signalToSet = 0;
+}
+
+MidiParser_SCI::~MidiParser_SCI() {
+ unloadMusic();
+}
+
+bool MidiParser_SCI::loadMusic(SoundResource::Track *track, MusicEntry *psnd, int channelFilterMask, SciVersion soundVersion) {
+ unloadMusic();
+ _track = track;
+ _pSnd = psnd;
+ _soundVersion = soundVersion;
+
+ setVolume(psnd->volume);
+
+ if (channelFilterMask) {
+ // SCI0 only has 1 data stream, but we need to filter out channels depending on music hardware selection
+ midiFilterChannels(channelFilterMask);
+ } else {
+ midiMixChannels();
+ }
+
+ _num_tracks = 1;
+ _tracks[0] = _mixedData;
+ setTrack(0);
+ _loopTick = 0;
+ return true;
+}
+
+void MidiParser_SCI::unloadMusic() {
+ allNotesOff();
+ resetTracking();
+ _num_tracks = 0;
+ if (_mixedData) {
+ delete[] _mixedData;
+ _mixedData = NULL;
+ }
+}
+
+void MidiParser_SCI::parseNextEvent(EventInfo &info) {
+ // Set signal AFTER waiting for delta, otherwise we would set signal too soon resulting in all sorts of bugs
+ if (_signalSet) {
+ _signalSet = false;
+ _pSnd->signal = _signalToSet;
+ debugC(2, kDebugLevelSound, "signal %04x", _signalToSet);
+ }
+
+ info.start = _position._play_pos;
+ info.delta = 0;
+ while (*_position._play_pos == 0xF8) {
+ info.delta += 240;
+ _position._play_pos++;
+ }
+ info.delta += *(_position._play_pos++);
+
+ // Process the next info.
+ if ((_position._play_pos[0] & 0xF0) >= 0x80)
+ info.event = *(_position._play_pos++);
+ else
+ info.event = _position._running_status;
+ if (info.event < 0x80)
+ return;
+
+ _position._running_status = info.event;
+ switch (info.command()) {
+ case 0xC:
+ info.basic.param1 = *(_position._play_pos++);
+ info.basic.param2 = 0;
+ if (info.channel() == 0xF) {// SCI special case
+ if (info.basic.param1 != kSetSignalLoop) {
+ _signalSet = true;
+ _signalToSet = info.basic.param1;
+ } else {
+ _loopTick = _position._play_tick;
+ }
+ }
+ break;
+ case 0xD:
+ info.basic.param1 = *(_position._play_pos++);
+ info.basic.param2 = 0;
+ break;
+
+ case 0xB:
+ info.basic.param1 = *(_position._play_pos++);
+ info.basic.param2 = *(_position._play_pos++);
+ if (info.channel() == 0xF) {// SCI special
+ // Reference for some events:
+ // http://wiki.scummvm.org/index.php/SCI/Specifications/Sound/SCI0_Resource_Format#Status_Reference
+ // Also, sci/sound/iterator/iterator.cpp, function BaseSongIterator::parseMidiCommand()
+ switch (info.basic.param1) {
+ case kSetReverb:
+ // TODO: Not implemented yet
+ break;
+ case kMidiHold:
+ // Check if the hold ID marker is the same as the hold ID
+ // marker set for that song by cmdSetSoundHold.
+ // If it is, loop back, but don't stop notes when jumping.
+ if (info.basic.param2 == _pSnd->hold)
+ jumpToTick(_loopTick, false, false);
+ break;
+ case kUpdateCue:
+ switch (_soundVersion) {
+ case SCI_VERSION_0_EARLY:
+ case SCI_VERSION_0_LATE:
+ _pSnd->dataInc += info.basic.param2;
+ _signalSet = true;
+ _signalToSet = 0x7f + _pSnd->dataInc;
+ break;
+ case SCI_VERSION_1_EARLY:
+ case SCI_VERSION_1_LATE:
+ _pSnd->dataInc++;
+ break;
+ default:
+ break;
+ }
+ break;
+ // Unhandled SCI commands
+ case 0x46: // LSL3 - binoculars
+ case 0x61: // Iceman (Adlib?)
+ case 0x73: // Hoyle
+ case 0xd1: // KQ4, when riding the unicorn
+ // Obscure SCI commands - ignored
+ break;
+ // Standard MIDI commands
+ case 0x01: // mod wheel
+ case 0x04: // foot controller
+ case 0x07: // channel volume
+ case 0x0A: // pan
+ case 0x0B: // expression
+ case 0x40: // sustain
+ case 0x4E: // velocity control
+ case 0x79: // reset all
+ case 0x7B: // notes off
+ // These are all handled by the music driver, so ignore them
+ break;
+ case 0x4B: // voice mapping
+ // TODO: is any support for this needed at the MIDI parser level?
+ warning("Unhanded SCI MIDI command 0x%x - voice mapping (parameter %d)", info.basic.param1, info.basic.param2);
+ break;
+ default:
+ warning("Unhandled SCI MIDI command 0x%x (parameter %d)", info.basic.param1, info.basic.param2);
+ break;
+ }
+ }
+ if (info.basic.param1 == 7) // channel volume change -scale it
+ info.basic.param2 = info.basic.param2 * _volume / 0x7F;
+ info.length = 0;
+ break;
+
+ case 0x8:
+ case 0x9:
+ case 0xA:
+ case 0xE:
+ info.basic.param1 = *(_position._play_pos++);
+ info.basic.param2 = *(_position._play_pos++);
+ if (info.command() == 0x9 && info.basic.param2 == 0)
+ info.event = info.channel() | 0x80;
+ info.length = 0;
+ break;
+
+ case 0xF: // System Common, Meta or SysEx event
+ switch (info.event & 0x0F) {
+ case 0x2: // Song Position Pointer
+ info.basic.param1 = *(_position._play_pos++);
+ info.basic.param2 = *(_position._play_pos++);
+ break;
+
+ case 0x3: // Song Select
+ info.basic.param1 = *(_position._play_pos++);
+ info.basic.param2 = 0;
+ break;
+
+ case 0x6:
+ case 0x8:
+ case 0xA:
+ case 0xB:
+ case 0xC:
+ case 0xE:
+ info.basic.param1 = info.basic.param2 = 0;
+ break;
+
+ case 0x0: // SysEx
+ info.length = readVLQ(_position._play_pos);
+ info.ext.data = _position._play_pos;
+ _position._play_pos += info.length;
+ break;
+
+ case 0xF: // META event
+ info.ext.type = *(_position._play_pos++);
+ info.length = readVLQ(_position._play_pos);
+ info.ext.data = _position._play_pos;
+ _position._play_pos += info.length;
+ if (info.ext.type == 0x2F) {// end of track reached
+ if (_pSnd->loop)
+ _pSnd->loop--;
+ if (_pSnd->loop) {
+ // We need to play it again...
+ jumpToTick(_loopTick);
+ } else {
+ _pSnd->status = kSoundStopped;
+ _pSnd->signal = SIGNAL_OFFSET;
+
+ debugC(2, kDebugLevelSound, "signal EOT");
+ }
+ }
+ break;
+ default:
+ warning(
+ "MidiParser_SCI::parseNextEvent: Unsupported event code %x",
+ info.event);
+ } // // System Common, Meta or SysEx event
+ }// switch (info.command())
+}
+
+
+byte MidiParser_SCI::midiGetNextChannel(long ticker) {
+ byte curr = 0xFF;
+ long closest = ticker + 1000000, next = 0;
+
+ for (int i = 0; i < _track->channelCount; i++) {
+ if (_track->channels[i].time == -1) // channel ended
+ continue;
+ next = *_track->channels[i].data; // when the next event shoudl occur
+ if (next == 0xF8) // 0xF8 means 240 ticks delay
+ next = 240;
+ next += _track->channels[i].time;
+ if (next < closest) {
+ curr = i;
+ closest = next;
+ }
+ }
+
+ return curr;
+}
+
+byte *MidiParser_SCI::midiMixChannels() {
+ int totalSize = 0;
+ byte **dataPtr = new byte *[_track->channelCount];
+
+ for (int i = 0; i < _track->channelCount; i++) {
+ dataPtr[i] = _track->channels[i].data;
+ _track->channels[i].time = 0;
+ _track->channels[i].prev = 0;
+ totalSize += _track->channels[i].size;
+ }
+
+ byte *mixedData = new byte[totalSize * 2]; // FIXME: creates overhead and still may be not enough to hold all data
+ _mixedData = mixedData;
+ long ticker = 0;
+ byte curr, delta;
+ byte cmd, par1, global_prev = 0;
+ long new_delta;
+ SoundResource::Channel *channel;
+ while ((curr = midiGetNextChannel(ticker)) != 0xFF) { // there is still active channel
+ channel = &_track->channels[curr];
+ delta = *channel->data++;
+ channel->time += (delta == 0xF8 ? 240 : delta); // when the comamnd is supposed to occur
+ if (delta == 0xF8)
+ continue;
+ new_delta = channel->time - ticker;
+ ticker += new_delta;
+
+ cmd = *channel->data++;
+ if (cmd != kEndOfTrack) {
+ // output new delta
+ while (new_delta > 240) {
+ *mixedData++ = 0xF8;
+ new_delta -= 240;
+ }
+ *mixedData++ = (byte)new_delta;
+ }
+ switch (cmd) {
+ case 0xF0: // sysEx
+ *mixedData++ = cmd;
+ do {
+ par1 = *channel->data++;
+ *mixedData++ = par1; // out
+ } while (par1 != 0xF7);
+ break;
+ case kEndOfTrack: // end channel
+ channel->time = -1; // FIXME
+ break;
+ default: // MIDI command
+ if (cmd & 0x80)
+ par1 = *channel->data++;
+ else {// running status
+ par1 = cmd;
+ cmd = channel->prev;
+ }
+ if (cmd != global_prev)
+ *mixedData++ = cmd; // out cmd
+ *mixedData++ = par1;// pout par1
+ if (nMidiParams[(cmd >> 4) - 8] == 2)
+ *mixedData++ = *channel->data++; // out par2
+ channel->prev = cmd;
+ global_prev = cmd;
+ }// switch(cmd)
+ }// while (curr)
+ // mixing finished. inserting stop event
+ *mixedData++ = 0;
+ *mixedData++ = 0xFF;
+ *mixedData++ = 0x2F;
+ *mixedData++ = 0x00;
+ *mixedData++ = 0x00;
+
+ for (int channelNr = 0; channelNr < _track->channelCount; channelNr++)
+ _track->channels[channelNr].data = dataPtr[channelNr];
+
+ delete[] dataPtr;
+ return _mixedData;
+}
+
+// This is used for SCI0 sound-data. SCI0 only has one stream that may
+// contain several channels and according to output device we remove
+// certain channels from that data.
+byte *MidiParser_SCI::midiFilterChannels(int channelMask) {
+ SoundResource::Channel *channel = &_track->channels[0];
+ byte *channelData = channel->data;
+ byte *channelDataEnd = channel->data + channel->size;
+ byte *filterData = new byte[channel->size + 5];
+ byte curChannel, curByte, curDelta;
+ byte command, lastCommand;
+ int delta = 0;
+ //int dataLeft = channel->size;
+ int midiParamCount;
+
+ _mixedData = filterData;
+ command = 0;
+ midiParamCount = 0;
+ lastCommand = 0;
+ curChannel = 15;
+
+ while (channelData < channelDataEnd) {
+ curDelta = *channelData++;
+ if (curDelta == 0xF8) {
+ delta += 240;
+ continue;
+ }
+ delta += curDelta;
+ curByte = *channelData++;
+
+ switch (curByte) {
+ case 0xF0: // sysEx
+ case kEndOfTrack: // end of channel
+ command = curByte;
+ curChannel = 15;
+ break;
+ default:
+ if (curByte & 0x80) {
+ command = curByte;
+ curChannel = command & 0x0F;
+ midiParamCount = nMidiParams[(command >> 4) - 8];
+ }
+ }
+ if ((1 << curChannel) & channelMask) {
+ if (command != kEndOfTrack) {
+ debugC(2, kDebugLevelSound, "\nDELTA ");
+ // Write delta
+ while (delta > 240) {
+ *filterData++ = 0xF8;
+ debugC(2, kDebugLevelSound, "F8 ");
+ delta -= 240;
+ }
+ *filterData++ = (byte)delta;
+ debugC(2, kDebugLevelSound, "%02X ", delta);
+ delta = 0;
+ }
+ // Write command
+ switch (command) {
+ case 0xF0: // sysEx
+ *filterData++ = command;
+ debugC(2, kDebugLevelSound, "%02X ", command);
+ do {
+ curByte = *channelData++;
+ *filterData++ = curByte; // out
+ } while (curByte != 0xF7);
+ lastCommand = command;
+ break;
+
+ case kEndOfTrack: // end of channel
+ break;
+
+ default: // MIDI command
+ if (lastCommand != command) {
+ *filterData++ = command;
+ debugC(2, kDebugLevelSound, "%02X ", command);
+ lastCommand = command;
+ }
+ if (midiParamCount > 0) {
+ if (curByte & 0x80) {
+ debugC(2, kDebugLevelSound, "%02X ", *channelData);
+ *filterData++ = *channelData++;
+ } else {
+ debugC(2, kDebugLevelSound, "%02X ", curByte);
+ *filterData++ = curByte;
+ }
+ }
+ if (midiParamCount > 1) {
+ debugC(2, kDebugLevelSound, "%02X ", *channelData);
+ *filterData++ = *channelData++;
+ }
+ }
+ } else {
+ if (curByte & 0x80) {
+ channelData += midiParamCount;
+ } else {
+ channelData += midiParamCount - 1;
+ }
+ }
+ }
+ // Stop event
+ *filterData++ = 0; // delta
+ *filterData++ = 0xFF; // Meta-Event
+ *filterData++ = 0x2F; // End-Of-Track
+ *filterData++ = 0x00;
+ *filterData++ = 0x00;
+
+ return _mixedData;
+}
+
+void MidiParser_SCI::setVolume(byte bVolume) {
+ if (bVolume > 0x7F)
+ bVolume = 0x7F;
+ if (_volume != bVolume) {
+ _volume = bVolume;
+
+ switch (_soundVersion) {
+ case SCI_VERSION_0_EARLY:
+ case SCI_VERSION_0_LATE: {
+ MidiPlayer *SCIDriver = (MidiPlayer *)_driver;
+ int16 globalVolume = _volume * 15 / 127;
+ SCIDriver->setVolume(globalVolume);
+ break;
+ }
+
+ case SCI_VERSION_1_EARLY:
+ case SCI_VERSION_1_LATE:
+ // sending volume change to all active channels
+ for (int i = 0; i < _track->channelCount; i++)
+ if (_track->channels[i].number <= 0xF)
+ _driver->send(0xB0 + _track->channels[i].number, 7, _volume);
+ break;
+
+ default:
+ error("MidiParser_SCI::setVolume: Unsupported soundVersion");
+ }
+ }
+}
+
+} // End of namespace Sci
Copied: scummvm/trunk/engines/sci/sound/midiparser_sci.h (from rev 47006, scummvm/trunk/engines/sci/sfx/midiparser.h)
===================================================================
--- scummvm/trunk/engines/sci/sound/midiparser_sci.h (rev 0)
+++ scummvm/trunk/engines/sci/sound/midiparser_sci.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -0,0 +1,85 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef SCI_MIDIPARSER_H
+#define SCI_MIDIPARSER_H
+
+#include "sci/resource.h"
+#include "sci/sound/music.h"
+#include "sound/midiparser.h"
+
+/*
+ Sound drivers info: (from driver cmd0)
+ Adlib/SB : track 0 , voices 9 , patch 3 ah=1
+ ProAudioSp: track 0 , voices 9 , patch 3 ah=17
+ GenerlMIDI: track 7 , voices 32, patch 4 ah=1 SCI1.1
+ Game Blast: track 9 , voices 12, patch 101 ah=1
+ MT-32 : track 12, voices 32, patch 1 ah=1
+ PC Speaker: track 18, voices 1 , patch 0xFF ah=1
+ Tandy : track 19, voices 3 , patch 101 ah=1
+ IBM PS/1 : track 19, voices 3 , patch 101 ah=1
+
+ */
+
+namespace Sci {
+
+class MidiParser_SCI : public MidiParser {
+public:
+ MidiParser_SCI(SciVersion soundVersion);
+ ~MidiParser_SCI();
+ bool loadMusic(SoundResource::Track *track, MusicEntry *psnd, int channelFilterMask, SciVersion soundVersion);
+ bool loadMusic(byte *, uint32) {
+ return false;
+ }
+ void unloadMusic();
+ void setVolume(byte bVolume);
+ void stop() {
+ _abort_parse = true;
+ allNotesOff();
+ }
+ void pause() {
+ allNotesOff();
+ }
+
+protected:
+ void parseNextEvent(EventInfo &info);
+ byte *midiMixChannels();
+ byte *midiFilterChannels(int channelMask);
+ byte midiGetNextChannel(long ticker);
+
+ SciVersion _soundVersion;
+ byte *_mixedData;
+ SoundResource::Track *_track;
+ MusicEntry *_pSnd;
+ uint32 _loopTick;
+ byte _volume;
+
+ bool _signalSet;
+ int16 _signalToSet;
+};
+
+} // End of namespace Sci
+
+#endif
Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/music.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -31,9 +31,9 @@
#include "sci/resource.h"
#include "sci/engine/kernel.h"
#include "sci/engine/state.h"
-#include "sci/sfx/midiparser.h"
-#include "sci/sfx/music.h"
-#include "sci/sfx/softseq/pcjr.h"
+#include "sci/sound/midiparser_sci.h"
+#include "sci/sound/music.h"
+#include "sci/sound/softseq/pcjr.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/sound/music.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/music.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -37,7 +37,7 @@
#include "sci/sci.h"
#include "sci/resource.h"
-#include "sci/sfx/softseq/mididriver.h"
+#include "sci/sound/softseq/mididriver.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/sound/seq/gm.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/seq/gm.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/seq/gm.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -25,8 +25,8 @@
#include "common/util.h"
-#include "sci/sfx/seq/midiwriter.h"
-#include "sci/sfx/seq/instrument-map.h"
+#include "sci/sound/seq/midiwriter.h"
+#include "sci/sound/seq/instrument-map.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/sound/seq/instrument-map.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/seq/instrument-map.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/seq/instrument-map.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -24,8 +24,8 @@
*/
#include "common/scummsys.h"
-#include "sci/sfx/softseq/mididriver.h"
-#include "sci/sfx/seq/instrument-map.h"
+#include "sci/sound/softseq/mididriver.h"
+#include "sci/sound/seq/instrument-map.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/sound/seq/instrument-map.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/seq/instrument-map.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/seq/instrument-map.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -28,7 +28,7 @@
#ifndef SCI_SFX_SEQ_INSTRUMENT_MAP_H
#define SCI_SFX_SEQ_INSTRUMENT_MAP_H
-#include "sci/sfx/seq/midiwriter.h"
+#include "sci/sound/seq/midiwriter.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/sound/seq/map-mt32-to-gm.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/seq/map-mt32-to-gm.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/seq/map-mt32-to-gm.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,7 +26,7 @@
#include "common/scummsys.h"
#include "sci/resource.h"
#include "sci/engine/state.h"
-#include "sci/sfx/seq/instrument-map.h"
+#include "sci/sound/seq/instrument-map.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/sound/softseq/adlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/softseq/adlib.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -29,7 +29,7 @@
#include "sound/softsynth/emumidi.h"
#include "sci/resource.h"
-#include "sci/sfx/softseq/mididriver.h"
+#include "sci/sound/softseq/mididriver.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/sound/softseq/amiga.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/softseq/amiga.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/softseq/amiga.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -24,7 +24,7 @@
*/
#include "sound/softsynth/emumidi.h"
-#include "sci/sfx/softseq/mididriver.h"
+#include "sci/sound/softseq/mididriver.h"
#include "common/file.h"
#include "common/frac.h"
Modified: scummvm/trunk/engines/sci/sound/softseq/pcjr.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/softseq/pcjr.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/softseq/pcjr.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -23,8 +23,8 @@
*
*/
-#include "sci/sfx/softseq/mididriver.h"
-#include "sci/sfx/softseq/pcjr.h"
+#include "sci/sound/softseq/mididriver.h"
+#include "sci/sound/softseq/pcjr.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/sound/softseq/pcjr.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/softseq/pcjr.h 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/softseq/pcjr.h 2010-01-05 01:22:16 UTC (rev 47007)
@@ -23,7 +23,7 @@
*
*/
-#include "sci/sfx/softseq/mididriver.h"
+#include "sci/sound/softseq/mididriver.h"
namespace Sci {
Modified: scummvm/trunk/engines/sci/sound/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp 2010-01-05 01:14:08 UTC (rev 47006)
+++ scummvm/trunk/engines/sci/sound/soundcmd.cpp 2010-01-05 01:22:16 UTC (rev 47007)
@@ -26,11 +26,11 @@
#include "sci/sci.h" // for USE_OLD_MUSIC_FUNCTIONS
#ifdef USE_OLD_MUSIC_FUNCTIONS
-#include "sci/sfx/iterator/iterator.h" // for SongIteratorStatus
+#include "sci/sound/iterator/iterator.h" // for SongIteratorStatus
#endif
-#include "sci/sfx/music.h"
-#include "sci/sfx/soundcmd.h"
+#include "sci/sound/music.h"
+#include "sci/sound/soundcmd.h"
namespace Sci {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list