
|
|
Author |
Message |
AlumiuN
DieHard Wolfer

Joined: 29 Nov 2007
Last Visit: 20:07 ago.
Topics: 38
Posts: 2537
Location: Christchurch, New Zealand

|
Posted: Thu Jul 23, 2009 1:47 am
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

 
|
|
Same directory as the EXE.  |
|
|
 |
RichterBelmont12
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 7:29 ago.
Topics: 98
Posts: 1516
Location: New Jersey

|
|
 |
AlumiuN
DieHard Wolfer

Joined: 29 Nov 2007
Last Visit: 20:07 ago.
Topics: 38
Posts: 2537
Location: Christchurch, New Zealand

|
Posted: Thu Jul 23, 2009 1:39 pm
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
Huh. Try using SDL_mixer 1.2.5. I'll look into packaging up a full DLL set with the sound manager.  |
|
|
 |
RichterBelmont12
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 7:29 ago.
Topics: 98
Posts: 1516
Location: New Jersey

|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 13:03 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Fri Oct 16, 2009 6:02 pm
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
Hey, quick question:
What exactly does this do? I'd like to know exactly before I decide to implement it into my code. I'm just asking here because I didn't know where else to ask. |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
RichterBelmont12
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 7:29 ago.
Topics: 98
Posts: 1516
Location: New Jersey

|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 13:03 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Fri Oct 16, 2009 6:39 pm
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
So, you can use stuff like Wavs, MP3's, or MIDIs instead of the imfs of the original? Well, what about importing them, do you have to stick them into the wolfenstein data files, or just have them in a seperate folder?
Oh, and what about the original files that hold sounds (AUDIOT, VSWAP, etc.) what do you do about those? |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
RichterBelmont12
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 7:29 ago.
Topics: 98
Posts: 1516
Location: New Jersey

|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 21 Feb 2019
Topics: 165
Posts: 8330
Location: Neo-traditions, Inc.

|
|
 |
RichterBelmont12
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 7:29 ago.
Topics: 98
Posts: 1516
Location: New Jersey

|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 13:03 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Fri Oct 16, 2009 11:04 pm
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
Nah, you're explainations are more than enough, and I'll check out the demo when I can. |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
AlumiuN
DieHard Wolfer

Joined: 29 Nov 2007
Last Visit: 20:07 ago.
Topics: 38
Posts: 2537
Location: Christchurch, New Zealand

|
Posted: Sun Oct 18, 2009 2:01 am
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
I should probably clarify this. AUDIOHED and AUDIOT can be completely deleted, and all of the sounds in the VSWAP can be removed. Then you put sounds in the 'sounds' directory and music in the 'music' directory. The names for the files can be changed in asmcref.h.  |
|
|
 |
Metalor
DieHard Mutant


Joined: 24 Aug 2005
Last Visit: 13:03 ago.
Topics: 95
Posts: 916
Location: California

|
Posted: Sun Oct 18, 2009 9:58 am
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
Cool! Of course, now I wonder how to delete the sounds in the VSWAP, since there's no "delete" button in any of the editors (that I can remember) |
_________________ - Taking a hiatus from Wolfenstein for a while...
...But I'll be back, you can count on it!
|
|
 |
TexZK
DieHard SS


Joined: 07 Feb 2004
Last Visit: 19 Oct 2016
Topics: 19
Posts: 370
Location: Northern Italy

|
Posted: Sun Oct 18, 2009 10:39 am
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
I'd really like to hear a real sound manager for Wolf, since the DOS heritage isn't that good... altough that of Wolf4SDL is already better! |
|
|
 |
insurrectionman
DieHard Mutant


Joined: 07 May 2005
Last Visit: 04 Feb 2019
Topics: 87
Posts: 759
Location: Wisconsin

|
Posted: Sun Oct 18, 2009 11:05 am
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
I've been using this manager and I know it does have some limits, but for stupid reasons, such as, you can't have it switching between MIDI and MP3, it'll freeze up, and I've still had problems with mp3's where they don't switch very well. I'm guessing its the smpeg.dll file I have may not be the best. But overall I like it, I've composed a bunch of new songs for my mod and they all are really good, I think. |
_________________ I'm back! I missed this community!
Youtube Channel: TreeSapThief
New Site: http://www.treesapthief.com
Twitter: @treesapthief
|
|
 |
RichterBelmont12
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 7:29 ago.
Topics: 98
Posts: 1516
Location: New Jersey

|
|
 |
AlumiuN
DieHard Wolfer

Joined: 29 Nov 2007
Last Visit: 20:07 ago.
Topics: 38
Posts: 2537
Location: Christchurch, New Zealand

|
|
 |
AlumiuN
DieHard Wolfer

Joined: 29 Nov 2007
Last Visit: 20:07 ago.
Topics: 38
Posts: 2537
Location: Christchurch, New Zealand

|
Posted: Sun Nov 08, 2009 4:48 pm
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
Long-post tutorial time! This tutorial will give you a new sound menu that removes the useless options and gives you some volume sliders and a reverse stereo button, as well as variables for the volume and reverseness that will be stored in the config file. You will need v0.9.1 for this to work (see the first post).
In WL_MENU.CPP:
1. Replace your CP_Sound and DrawSoundMenu with the following code:
::: CODE :::
void
DrawSliderBox(int x, int y, int val, int valinc, int width, int height, byte colour)
{
byte usecolour;
if (colour == READCOLOR)
usecolour = READHCOLOR;
else
usecolour = HIGHLIGHT;
DrawOutline (x + valinc * val, y, width, height, 0, colour);
VWB_Bar (x + 1 + valinc * val, y + 1, width - 1, height - 1, usecolour);
}
void
DrawSoundVols (bool curmode)
{
ClearMScreen ();
DrawWindow (40, 25, 240, 145, BKGDCOLOR);
VWB_DrawPic (112, 184, C_MOUSELBACKPIC);
WindowX = 0;
WindowW = 320;
PrintY = 30;
SETFONTCOLOR (READCOLOR, BKGDCOLOR);
US_CPrint ("Adjust Volume");
PrintY = 58;
SETFONTCOLOR (TEXTCOLOR, BKGDCOLOR);
US_CPrint ("Sound");
PrintY = 108;
US_CPrint ("Music");
char soundstr[4], musicstr[4];
sprintf(soundstr, "%d", soundvol);
sprintf(musicstr, "%d", musicvol);
if (curmode)
{
SETFONTCOLOR (TEXTCOLOR, BKGDCOLOR);
}
else
{
SETFONTCOLOR (READCOLOR, BKGDCOLOR);
}
PrintX = 65 + soundvol * 2 - strlen(soundstr) * 4;
PrintY = 84;
US_Print (soundstr);
if (!curmode)
{
SETFONTCOLOR (TEXTCOLOR, BKGDCOLOR);
}
else
{
SETFONTCOLOR (READCOLOR, BKGDCOLOR);
}
PrintX = 65 + musicvol * 2 - strlen(musicstr) * 4;
PrintY = 134;
US_Print (musicstr);
VWB_Bar (60, 72, 210, 10, TEXTCOLOR);
DrawOutline (60, 72, 210, 10, 0, HIGHLIGHT);
VWB_Bar (60, 122, 210, 10, TEXTCOLOR);
DrawOutline (60, 122, 210, 10, 0, HIGHLIGHT);
DrawSliderBox(60, 72, soundvol, 2, 10, 10, (curmode) ? TEXTCOLOR : READCOLOR);
DrawSliderBox(60, 122, musicvol, 2, 10, 10, (curmode) ? READCOLOR : TEXTCOLOR);
VW_UpdateScreen ();
}
int
AdjustVolume (int)
{
ControlInfo ci;
int exit = 0, oldSV = soundvol, oldMV = musicvol;
bool curmode = 0;
DrawSoundVols (curmode);
MenuFadeIn ();
WaitKeyUp();
do
{
SDL_Delay(5);
ReadAnyControl (&ci);
switch (ci.dir)
{
case dir_North:
case dir_South:
curmode = (curmode) ? 0 : 1;
DrawSoundVols(curmode);
IN_ClearKeysDown();
break;
case dir_West:
if (curmode)
{
if (musicvol > 0)
{
musicvol--;
DrawSoundVols(curmode);
SD_ChangeVolume((byte) (soundvol * 1.28), (byte) (musicvol * 1.28));
TicDelay(2);
}
}
else
{
if (soundvol > 0)
{
soundvol--;
DrawSoundVols(curmode);
SD_ChangeVolume((byte) (soundvol * 1.28), (byte) (musicvol * 1.28));
TicDelay(2);
}
}
break;
case dir_East:
if (curmode)
{
if (musicvol < 100)
{
musicvol++;
DrawSoundVols(curmode);
SD_ChangeVolume((byte) (soundvol * 1.28), (byte) (musicvol * 1.28));
TicDelay(2);
}
}
else
{
if (soundvol < 100)
{
soundvol++;
DrawSoundVols(curmode);
SD_ChangeVolume((byte) (soundvol * 1.28), (byte) (musicvol * 1.28));
TicDelay(2);
}
}
break;
}
if (ci.button0 || Keyboard[sc_Space] || Keyboard[sc_Enter])
exit = 1;
else if (ci.button1 || Keyboard[sc_Escape])
exit = 2;
}
while (!exit);
if (exit == 2)
{
soundvol = oldSV;
musicvol = oldMV;
SD_PlaySound (ESCPRESSEDSND);
}
else
SD_PlaySound (SHOOTSND);
WaitKeyUp ();
MenuFadeOut ();
return 0;
}
int
CP_Sound (int)
{
int which;
DrawSoundMenu ();
MenuFadeIn ();
WaitKeyUp ();
do
{
which = HandleMenu (&SndItems, &SndMenu[0], NULL);
//
// HANDLE MENU CHOICES
//
switch (which)
{
//
// SOUND EFFECTS
//
case 0:
if (SoundMode != sdm_Off)
{
SD_WaitSoundDone ();
SD_SetSoundMode (sdm_Off);
DrawSoundMenu ();
}
break;
case 1:
if (SoundMode != sdm_AdLib)
{
SD_WaitSoundDone ();
SD_SetSoundMode (sdm_AdLib);
CA_LoadAllSounds ();
DrawSoundMenu ();
ShootSnd ();
}
break;
//
// MUSIC
//
case 4:
if (MusicMode != smm_Off)
{
SD_SetMusicMode (smm_Off);
DrawSoundMenu ();
ShootSnd ();
}
break;
case 5:
if (MusicMode != smm_AdLib)
{
SD_SetMusicMode (smm_AdLib);
DrawSoundMenu ();
ShootSnd ();
StartCPMusic (MENUSONG);
}
break;
case 8:
DrawSoundMenu();
MenuFadeIn ();
WaitKeyUp ();
break;
case 9:
reversestereo ^= 1;
SD_Reverse(reversestereo);
DrawSoundMenu();
ShootSnd();
}
}
while (which >= 0);
MenuFadeOut ();
return 0;
}
void
DrawSoundMenu (void)
{
int i, on;
//
// DRAW SOUND MENU
//
ClearMScreen ();
VWB_DrawPic (112, 184, C_MOUSELBACKPIC);
DrawWindow (SM_X - 8, SM_Y1 - 3, SM_W, SM_H1, BKGDCOLOR);
DrawWindow (SM_X - 8, SM_Y2 - 3, SM_W, SM_H2, BKGDCOLOR);
DrawWindow (SM_X - 8, SM_Y3 - 3, SM_W, SM_H3, BKGDCOLOR);
VWB_DrawPic (100, SM_Y1 - 20, C_FXTITLEPIC);
VWB_DrawPic (100, SM_Y2 - 20, C_MUSICTITLEPIC);
VWB_DrawPic (100, SM_Y3 - 20, C_DIGITITLEPIC);
DrawMenu (&SndItems, &SndMenu[0]);
for (i = 0; i < SndItems.amount; i++)
if (SndMenu[i].string[0])
{
//
// DRAW SELECTED/NOT SELECTED GRAPHIC BUTTONS
//
on = 0;
switch (i)
{
//
// SOUND EFFECTS
//
case 0:
if (SoundMode == sdm_Off)
on = 1;
break;
case 1:
if (SoundMode == sdm_AdLib)
on = 1;
break;
//
// MUSIC
//
case 4:
if (MusicMode == smm_Off)
on = 1;
break;
case 5:
if (MusicMode == smm_AdLib)
on = 1;
break;
case 9:
if (reversestereo)
on = 1;
break;
}
if (i < 6 || i > 8)
{
if (on)
VWB_DrawPic (SM_X + 24, SM_Y1 + i * 13 + 2, C_SELECTEDPIC);
else
VWB_DrawPic (SM_X + 24, SM_Y1 + i * 13 + 2, C_NOTSELECTEDPIC);
}
}
DrawMenuGun (&SndItems);
VW_UpdateScreen ();
}
2. Now find the line:
::: CODE :::
CP_itemtype SndMenu[] = {
and replace everything below it to the curly bracket with the following code:
::: CODE :::
{1, "Off", 0},
{1, "On", 0},
{0, "", 0},
{0, "", 0},
{1, "Off", 0},
{1, "On", 0},
{0, "", 0},
{0, "", 0},
{1, "Adjust Volume", AdjustVolume},
{1, "Reverse Stereo", 0},
In WL_MENU.H
1. Find the line:
::: CODE :::
#define SM_Y1 20
and replace it and the next five lines with:
::: CODE :::
#define SM_Y1 20
#define SM_H1 3*13-7
#define SM_Y2 SM_Y1+4*13
#define SM_H2 3*13-7
#define SM_Y3 SM_Y2+4*13
#define SM_H3 3*13-7
2. Add the following code to the bottom of the file:
::: CODE :::
void DrawSoundVols(bool);
int AdjustVolume(int);
That's the menu sorted. Now to add the actual volume and reversing variables.
In WL_MAIN.CPP:
1. Below the line:
::: CODE :::
read(file,&mouseadjustment,sizeof(mouseadjustment));
Add the lines:
::: CODE :::
read(file,&soundvol,sizeof(soundvol));
read(file,&musicvol,sizeof(musicvol));
read(file,&reversestereo,sizeof(reversestereo));
2. Below the line:
::: CODE :::
write(file,&mouseadjustment,sizeof(mouseadjustment));
Add the lines:
::: CODE :::
write(file,&soundvol,sizeof(soundvol));
write(file,&musicvol,sizeof(musicvol));
write(file,&reversestereo,sizeof(reversestereo));
3. Below the line:
::: CODE :::
else if(viewsize>21) viewsize=21;
Add the lines:
::: CODE :::
if (soundvol > 100) soundvol = 100;
if (musicvol > 100) musicvol = 100;
4. Below the line:
::: CODE :::
mouseadjustment=5;
Add the lines:
::: CODE :::
soundvol = 100;
musicvol = 100;
reversestereo = false;
5. Below the line:
::: CODE :::
SD_SetSoundMode (sd);
Add the lines:
::: CODE :::
SD_ChangeVolume ((byte) (soundvol * 1.28), (byte) (musicvol * 1.28));
SD_Reverse(reversestereo);
6. Below the line:
::: CODE :::
int mouseadjustment;
Add the lines:
::: CODE :::
byte soundvol, musicvol;
bool reversestereo;
In WL_DEF.H
Add the following lines to the bottom of the file:
::: CODE :::
extern byte soundvol, musicvol;
extern bool reversestereo;
There we go. Now you have modifiable sound volumes and reversible sound channels.  |
|
|
 |
RichterBelmont12
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 7:29 ago.
Topics: 98
Posts: 1516
Location: New Jersey

|
|
 |
AlumiuN
DieHard Wolfer

Joined: 29 Nov 2007
Last Visit: 20:07 ago.
Topics: 38
Posts: 2537
Location: Christchurch, New Zealand

|
Posted: Mon Nov 09, 2009 12:52 am
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
Okay. Have you installed the latest patch in the first post? Both of those are functions defined in asmcomp.h in v0.9.1. If you've installed the manager correctly and it was working before, it should be working now. |
|
|
 |
RichterBelmont12
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 7:29 ago.
Topics: 98
Posts: 1516
Location: New Jersey

|
|
 |
AlumiuN
DieHard Wolfer

Joined: 29 Nov 2007
Last Visit: 20:07 ago.
Topics: 38
Posts: 2537
Location: Christchurch, New Zealand

|
Posted: Tue Nov 10, 2009 12:56 am
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
Whoops, I linked it to the Pre-Installed v0.9. I hope you didn't overwrite all of your source code with it. I've updated the link in the first post.  |
|
|
 |
RichterBelmont12
DieHard Wolfer


Joined: 14 Aug 2004
Last Visit: 7:29 ago.
Topics: 98
Posts: 1516
Location: New Jersey

|
|
 |
Andy_Nonymous
Moderator


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015
Topics: 99
Posts: 589
Location: New Jersey, USA

|
Posted: Fri Mar 26, 2010 1:10 pm
Subject: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
AlumiuN,
Nice job on this! I got it to work and love what I see (and hear). Definitely a major contribution to the Wolf3d coding history!
The pre-installed code would not compile for me under Dev-C++ for some reason, but following your directions for the do-it-yourselfers worked without a hitch.
All I would add to your tutorials/directions is that with each code change (wolf4sdl1.6 -> ASM 0.9 or ASM 0.9 -> ASM 0.91), delete any existing config.wl6 files before testing or you will get some "interesting" problems, like losing your gun each time you open a door, etc.
The error I get with the pre-installed code: id_vl.cpp opens up and highlights the line 'unsigned screenBits = -1;' and two messages come up: 'cannot find -logg' and 'Id returned 1 exit status'. Very cryptic Did I goof something up here?
Audiosod.h is not in your pre-installed code, but adding it and 'rebuilding all' did not fix this problem (I know, it was a longshot ).
Andy |
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 21 Feb 2019
Topics: 165
Posts: 8330
Location: Neo-traditions, Inc.

|
|
 |
Andy_Nonymous
Moderator


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015
Topics: 99
Posts: 589
Location: New Jersey, USA

|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 21 Feb 2019
Topics: 165
Posts: 8330
Location: Neo-traditions, Inc.

|
Posted: Mon Mar 29, 2010 8:08 pm
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
My mistake, Andy; I misread. IIRC, you actually change WL_MAIN.CPP instead. I don't remember modifying VL_ID.CPP to get anything working, but it's been quite a while since I did "vanilla coding" with Wolf4SDL.  |
|
|
 |
Andy_Nonymous
Moderator


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015
Topics: 99
Posts: 589
Location: New Jersey, USA

|
Posted: Tue Mar 30, 2010 8:56 am
Subject: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
AlumiuN,
Currently, this code supports MP3/OGG/etc. formats for music files. Sound files are still limited to WAV. Is this a technical limitation? If not, could MP3/OGG support be added for the sound files too?
As an example, the Project: X Insurrection demo has 19 MB of sounds, which could probably be cut down to 2-3 MB with OGG compression. Might be nice for the people on dial-up. And once ASM mods become more common, we wolf3d mod-collectors may be looking at using up 10's of Gigs of space for a 1990's era game!
Andy |
|
|
 |
AlumiuN
DieHard Wolfer

Joined: 29 Nov 2007
Last Visit: 20:07 ago.
Topics: 38
Posts: 2537
Location: Christchurch, New Zealand

|
Posted: Wed Mar 31, 2010 1:17 am
Subject: Re: Advanced Sound Manager - first working Beta!
[ IP : Logged ]
|

  
|
|
Erm... I'm pretty sure that only allowing WAVs for sound is a limitation in SDL_mixer. If I wanted to be REALLY pro, I could add some controls for loading OGGs as raw data and playing that through SDL_mixer, but that could get very messy very quickly. But I'll take a look. As for the '-logg' error (which causes the other one), you could try either removing that line from the project (there's a linker window or something like that in the project options) or by copying ogg.dll or libogg.dll (or whatever it's called) into the Dev-Cpp\lib folder.  |
|
|
 |
Andy_Nonymous
Moderator


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015
Topics: 99
Posts: 589
Location: New Jersey, USA

|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum
|
|
You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group
|