Skip to content

Commit

Permalink
Date: Sat, 19 Aug 2006 00:13:54 +0200
Browse files Browse the repository at this point in the history
From: Hans de Goede
Subject: PATCH: add volume control to playmus interactive mode

Hi,

First a short intro I'm a Linux enthousiast and developer, mainly
working on Linux gaming related stuff.

I've been working on getting d1x (descent 3d-shooter linux port) to play
the music from the original game. Now, 2 full days further I'm getting
there (as in nearly finished).

Because of <insert long story here if you really want to know ask> I
cannot use SDL_mixer directly from d1x, so I'm using popen("playmus -i
xxxx", "w") to start playmus todo the playback and I control it (-i is
interactive mode) by writing the nescesarry commands to the stdin FILE *
returned by popen.

However by default playmus' interactive mode doesn't allow changing the
volume, which I need to be able todo. The attached patch adds this
capability to playmus, and is otherwise harmless. I hope you can
incorperate this patch into playmus, so that I don't have to ship a
modified version as part of the d1x package.

Thanks & Regards,

Hans
  • Loading branch information
slouken committed Aug 20, 2006
1 parent a7467cd commit 263e9db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion playmus.c
Expand Up @@ -65,7 +65,7 @@ void Menu(void)
{
char buf[10];

printf("Available commands: (p)ause (r)esume (h)alt > ");
printf("Available commands: (p)ause (r)esume (h)alt volume(v#) > ");
fflush(stdin);
scanf("%s",buf);
switch(buf[0]){
Expand All @@ -78,6 +78,9 @@ void Menu(void)
case 'h': case 'H':
Mix_HaltMusic();
break;
case 'v': case 'V':
Mix_VolumeMusic(atoi(buf+1));
break;
}
printf("Music playing: %s Paused: %s\n", Mix_PlayingMusic() ? "yes" : "no",
Mix_PausedMusic() ? "yes" : "no");
Expand Down

0 comments on commit 263e9db

Please sign in to comment.