aboutsummaryrefslogtreecommitdiffstats
path: root/src/media
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-13 13:02:27 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-09-13 13:02:27 +0000
commita40eb015f8dc43ee087bb8374e67c6a75eb9fbc6 (patch)
tree06dd0d674128b84805cf0b72cab3263431b61456 /src/media
parentb0dcfe05f53197bd9f159e46d6cbc2cd3ebff5ca (diff)
downloadusdx-a40eb015f8dc43ee087bb8374e67c6a75eb9fbc6.tar.gz
usdx-a40eb015f8dc43ee087bb8374e67c6a75eb9fbc6.tar.xz
usdx-a40eb015f8dc43ee087bb8374e67c6a75eb9fbc6.zip
- stop both Video and Visualizer (because of the video-toggle with 'v'-key both could have been active) (See SF-tracker Patch 2078902)
- VideoLoaded does not belong to the song state anymore git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1381 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to 'src/media')
-rw-r--r--src/media/UVisualizer.pas28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/media/UVisualizer.pas b/src/media/UVisualizer.pas
index e2125201..879d6c42 100644
--- a/src/media/UVisualizer.pas
+++ b/src/media/UVisualizer.pas
@@ -78,15 +78,15 @@ type
PCMData: TPCMData;
RndPCMcount: integer;
- projMatrix: array[0..3, 0..3] of GLdouble;
- texMatrix: array[0..3, 0..3] of GLdouble;
+ ProjMatrix: array[0..3, 0..3] of GLdouble;
+ TexMatrix: array[0..3, 0..3] of GLdouble;
procedure VisualizerStart;
procedure VisualizerStop;
procedure VisualizerTogglePause;
- function GetRandomPCMData(var data: TPCMData): Cardinal;
+ function GetRandomPCMData(var Data: TPCMData): Cardinal;
procedure SaveOpenGLState();
procedure RestoreOpenGLState();
@@ -210,7 +210,7 @@ begin
// save projection-matrix
glMatrixMode(GL_PROJECTION);
- glGetDoublev(GL_PROJECTION_MATRIX, @projMatrix);
+ glGetDoublev(GL_PROJECTION_MATRIX, @ProjMatrix);
{$IF PROJECTM_VERSION = 1000000} // 1.0, 1.01
// bugfix: projection-matrix is popped without being pushed first
glPushMatrix();
@@ -218,7 +218,7 @@ begin
// save texture-matrix
glMatrixMode(GL_TEXTURE);
- glGetDoublev(GL_TEXTURE_MATRIX, @texMatrix);
+ glGetDoublev(GL_TEXTURE_MATRIX, @TexMatrix);
// save modelview-matrix
glMatrixMode(GL_MODELVIEW);
@@ -243,11 +243,11 @@ begin
// restore projection-matrix
glMatrixMode(GL_PROJECTION);
- glLoadMatrixd(@projMatrix);
+ glLoadMatrixd(@ProjMatrix);
// restore texture-matrix
glMatrixMode(GL_TEXTURE);
- glLoadMatrixd(@texMatrix);
+ glLoadMatrixd(@TexMatrix);
// restore modelview-matrix
glMatrixMode(GL_MODELVIEW);
@@ -293,7 +293,8 @@ begin
// We use the latter so we do not need to load the FBO extension in USDX.
pm.RenderFrame();
- VisualizerStarted := True;
+ VisualizerPaused := false;
+ VisualizerStarted := true;
finally
RestoreOpenGLState();
end;
@@ -303,7 +304,8 @@ procedure TVideoPlayback_ProjectM.VisualizerStop;
begin
if VisualizerStarted then
begin
- VisualizerStarted := False;
+ VisualizerPaused := false;
+ VisualizerStarted := false;
FreeAndNil(pm);
end;
end;
@@ -414,21 +416,21 @@ end;
* Produces random "sound"-data in case no audio-data is available.
* Otherwise the visualization will look rather boring.
*}
-function TVideoPlayback_ProjectM.GetRandomPCMData(var data: TPCMData): Cardinal;
+function TVideoPlayback_ProjectM.GetRandomPCMData(var Data: TPCMData): Cardinal;
var
i: integer;
begin
// Produce some fake PCM data
if (RndPCMcount mod 500 = 0) then
begin
- FillChar(data, SizeOf(TPCMData), 0);
+ FillChar(Data, SizeOf(TPCMData), 0);
end
else
begin
for i := 0 to 511 do
begin
- data[i][0] := Random(High(Word)+1);
- data[i][1] := Random(High(Word)+1);
+ Data[i][0] := Random(High(Word)+1);
+ Data[i][1] := Random(High(Word)+1);
end;
end;
Inc(RndPCMcount);