LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-12-2007, 04:57 AM   #1
tanoatlq
Member
 
Registered: Mar 2007
Posts: 157

Rep: Reputation: 30
scrolling in a window


Hello,
I'm trying to develop a small piece of code that shows waveforms
of a song while playing it.
My idea is this: precompute all values of all I want to display
while loading audio (in other words: build an offscreen image or
a similar object), then display the current part and scroll this
while playing..
However, I cannot find what library calls could help me to do
this in an *efficient* way, considering that all output should
be directed to an X Window or to a gtk widget like gtk drawing
area..
Any suggestions (opengl? direct rendering?)?
Thanks,
gaetano
 
Old 06-12-2007, 05:32 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
read xlib documentation comes along with X
 
Old 06-12-2007, 09:43 AM   #3
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
if java is an option, i remember seeing an item on this in oreilly's 'Swing Hacks', not sure of the edition.

There are probably hundreds of examples out there, check sourceforge.
 
Old 06-12-2007, 11:34 AM   #4
tanoatlq
Member
 
Registered: Mar 2007
Posts: 157

Original Poster
Rep: Reputation: 30
Two points:

1. I read x lib documentation and a programming book. However, X pixmaps seems to be limited in
memory to use as offscreen widgets, and I can't find a way to do something like scrolling
directly.

2. I cannot think java as an efficient way, because of its interpreter nature..
 
Old 06-12-2007, 12:10 PM   #5
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
Quote:
2. I cannot think java as an efficient way, because of its interpreter nature..
if the only thing restricting you from using java is that opinion.. then it may be worth your while to look into how java performs in reality compared to the how it performs in opinions.
 
Old 06-13-2007, 03:25 AM   #6
tanoatlq
Member
 
Registered: Mar 2007
Posts: 157

Original Poster
Rep: Reputation: 30
My pc is an old pentium celeron 600, so my opinion is empirically demonstrated every time
I look for a serious java project that involves multimedia.
An interpreter language run slower than a native language, in theory, and in practice this
difference become more evident when you want your pc do something that need a lot of resources
(multimedia, for example).
Or do you think that games like doom could be developed in java?
It is the cost we have to pay for its strength, portability.
Every language could be a solution for something, so when operating systems are developed
in c, c++, and assembly, java could be the best solution for rapid application developmnent
where portability is an important factor and performance a minor.
 
Old 06-13-2007, 09:38 AM   #7
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
i dont want to get into yet another discussion on java performance vs native languages. i am only be suggesting that rendering a waveform is far from a computationally intensive operation. just because you are playing audio and drawing some 2d graphics to the screen while doing it, dont lump it in with actual multimedia processing.

imo, if programmed efficiently, java would have no problem doing this. but in the end there are hundreds of ways to do it, mine was only a suggestion..

(btw, if you would want to check it out, look at the javax.sound package)
 
Old 06-13-2007, 01:38 PM   #8
tanoatlq
Member
 
Registered: Mar 2007
Posts: 157

Original Poster
Rep: Reputation: 30
Even if java could work well in this situation in my old pc,
the situation I represent here is an example of what I have to do.
I have to add something to what I describe, but
because the problem (almost for now) is in the visual representation
of the waveform, I build this example.
However, if java could do this well, and because java is build on top
of linux and X, than there is a good way to do this even without java.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Capture a scrolling window? evilc77 Linux - General 2 05-04-2007 09:08 PM
scrolling window in ncurses mayank_linux Programming 1 10-19-2006 06:03 PM
hard scrolling vs soft scrolling (console) haxcess Linux - General 2 08-30-2004 12:17 AM
Scrolling theoldman Linux - Newbie 0 09-25-2003 10:13 PM
Scrolling after ls... psyklops Linux - General 5 11-30-2002 11:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration