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!

TXT-Reader, supports vertical reading

Only for posting new releases of Dingoo OS based software.

Moderator: Moderators


Re: TXT-Reader, supports vertical reading

Postby vimrc on Mon Oct 12, 2009 10:58 pm

To batman52:

You got it. The X and Y are inverted... So if you select X in the configure menu, it should be Y... I almost forgot this stupid mistake. Sorry for my carelessness when transform the GP2X keys to Dingux Keys, it will be fixed soon.

EDIT:
batman52, it's a good idea to use Mplayer slave mode. So here is a fast hack! The modified player.cpp and binary file are attached. I changed the player.cpp as following:

Code: Select all
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);
  }
}


As I commented above, the mplayer.dge should be in //boot/local/apps/mplayer/, put several music files to the default directory (./), press R+Y to activate the player, now you should see them in the list, select one and press A, then enjoy it!

Currently the "pause" doesn't work, but it should be fixed. Another one is current player list only includes *.ogg, *.mp2, *.mp3. you can ddd dir.AddExt(".???") in the player.c as you like if you want to play more as wma, I will release more power of mplayer later. :) I haven't modified other codes about the player, so maybe play mode, volume up/down do not work right now, but these problems will be fixed definitely in the future.
Attachments
player.cpp.rar
(2 KiB) Downloaded 1 time
Greader2x_audio.rar
(606.88 KiB) Downloaded 1 time
vimrc
 
Posts: 47
Joined: Mon Jul 13, 2009 6:49 pm
Location: Delft, NL

Re: TXT-Reader, supports vertical reading

Postby batman52 on Tue Oct 13, 2009 7:46 am

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!
batman52
 
Posts: 69
Joined: Wed Jun 10, 2009 8:48 pm

Re: TXT-Reader, supports vertical reading

Postby vimrc on Tue Oct 13, 2009 9:53 am

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!


I agree with you, if the current version is little buggy, I will try to package the code into a library. Now The current version doesn't support background image which I will fix first, after that I want to rewrite the cpu and brightness module which should be easy to realize. For the mp3 list, I think maybe it's OK to add an if{} function to judge if the file is *.m3u (Maybe we can call the *.m3u generated by Gmu if users don't want to make this file himself), or we can code sth to generate *.m3u from the list of gread2x player. Thank you for your suggestions. If you have time, any modification about the version is welcome! :)
Last edited by vimrc on Tue Oct 13, 2009 11:21 am, edited 1 time in total.
vimrc
 
Posts: 47
Joined: Mon Jul 13, 2009 6:49 pm
Location: Delft, NL

Re: TXT-Reader, supports vertical reading

Postby codiak on Tue Oct 13, 2009 10:12 am

Nice to see someone working on that! Would be nice to have music while reading.
Maybe someone can move this thread to "Dingux Releases" ?
User avatar
codiak
 
Posts: 31
Joined: Thu Sep 17, 2009 10:19 am

Re: TXT-Reader, supports vertical reading

Postby vimrc on Tue Oct 13, 2009 3:31 pm

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" ?


Correct several bugs, I will start a new thread. Just now it's an alpha version. ;-)
vimrc
 
Posts: 47
Joined: Mon Jul 13, 2009 6:49 pm
Location: Delft, NL

Re: TXT-Reader, supports vertical reading

Postby batman52 on Tue Oct 13, 2009 8:50 pm

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.
batman52
 
Posts: 69
Joined: Wed Jun 10, 2009 8:48 pm

Re: TXT-Reader, supports vertical reading

Postby vimrc on Tue Oct 13, 2009 9:26 pm

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.


I have enabled the ipu in my zImage, I didn't feel any lag while scrolling the screen. Wait, I also enable the cache in
the mplayer config file, like this, is it the reason?

Code: Select all
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"



Yes, libmikmod.a is included in the latesttoolchain. I have fixed the reverse X and Y, and seems background picture using *.png works well except the *.jpg file (JPG will always cause the segment fault, i don't know the reason now.), the attached package includes two themes called liquido and tux. I have solved the volume problem using the codes from Dmenu by leo.5xl.bigfat. (Use L and R to increase or decrease volume) So here it is:

gread2x_dingux_update1.rar
(910.8 KiB) Downloaded 3 times

greader2x_src.rar
(1.24 MiB) Downloaded 1 time


PS: I am working on the music list now and will add your suggested Mix_OpenAudio part anyway. If I finished it, I will start a new threat ASAP. Thank you all!
vimrc
 
Posts: 47
Joined: Mon Jul 13, 2009 6:49 pm
Location: Delft, NL

Previous

Return to Dingoo OS Releases

Who is online

Users browsing this forum: No registered users and 0 guests