http://translate.googleusercontent.com/ ... yMSwxQXO-Q
http://dingoobr.blogspot.com/2009/08/eb ... o-gba.html
Welcome | |
---|---|
Welcome to a320
You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today! |
Moderator: Moderators
void TPlayer::loadFile(string fl) {
Mix_SetMusicCMD("/boot/local/apps/mplayer/mplayer.dge -slave"); //Here define the external command
music = Mix_LoadMUS(fl.c_str());
if(!music) {
fprintf(stderr,"Error: %s\n", Mix_GetError());
}
}
void TPlayer::play(void) {
if (playlist.size() > 0 && !playing) {
if (music == NULL) {
loadFile(playlist[currentTrack]);
}
playing = true;
paused = false;
Mix_CloseAudio(); //I have to add this line, because SDL will occupy the /dev/dsp. So have to release it before run Mplayer.
Mix_PlayMusic(music, 1);
}
}
batman52 wrote:Well done vimrc! (And fast!)
I wanted add myself the mplayer support, but you did it first...
I'll give you feedback as soon as I can (can't wait damn!). Anyway I want to give you another advice:
Since it would be very comfortable to call mplayer-slave in the same way from different applications (think about dmenu for instance), it would be very useful if you packed the music-related code into a library, creating a sort of standard interface, don't you agree?
I'd move the mplayer executable path into the config file too, instead than "hard wiring" into the code. Moreover, another easy-to-add feature is playlist support, calling mplayer with the option --playlist (or was it --list? can't remember atm).
I know, it's just a quick hack, i'm pretending too much, sorry...
Thanks again vimrc!
codiak wrote:Nice to see someone working on that! Would be nice to have music while reading.
Maybe someone can move this thread to "Dingux Releases" ?
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 1024);
chunksize is the size of each mixed sample. The smaller this is the more your hooks will be called. If make this too small on a slow system, sound may skip. If made to large, sound effects will lag behind the action more.
batman52 wrote:I just tried the audio enabled version.
comments: the audio lags while scrolling the screen and is very annoying. I had a look at the code and maybe this can be avoided reducing the chunksize in the openaudio call:
- Code: Select all
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 1024);
From SDL_mixer doc:chunksize is the size of each mixed sample. The smaller this is the more your hooks will be called. If make this too small on a slow system, sound may skip. If made to large, sound effects will lag behind the action more.
For the volume setting we can use the volset application calling /usr/apps/volset/volset with a system("...") call.
Here's as reference the list of mplayer commands in slave mode.
http://www.mplayerhq.hu/DOCS/tech/slave.txt
I tried to compile it myself, but it seems that my toolchain is missing libmikmod. Maybe am I using an old one?
PS: I agree with codiak, we are definitively going OT here.
cache="4960"
cache-min="50"
mc="0.000001"
msglevel="0"
fs="yes"
vo="fbdev"
zoom="yes"
x="320"
y="240"
screenh="240"
screenw="320"
osdlevel="0"
noterm-osd="yes"
vsync="no"
double="yes"
dr="yes"
sws="0"
osd-duration="50"
autosync="30"
mc="10"
Users browsing this forum: No registered users and 0 guests