Sunday, July 27, 2008

Saya-VE with SDL, experiment 1

I pasted and adapted some code from the wx-sdl project (see link in previous entry) into Saya. I created a new class called SDLPanel (original, heh?), and used it instead of a common wxPanel.

So far, here's how the painting works:

1) Check if the panel has an active SDL_Surface object
// can't draw if the screen doesn't exist yet
if (!m_Screen) {
return;
}
2) Lock the SDL_Surface. This thing is thread-safe!
// lock the surface if necessary
if (SDL_MUSTLOCK(m_Screen)) {
if (SDL_LockSurface(m_Screen) > 0) {
return;
}
}

3) Create an in-memory bitmap (a wxImage) based on a SDL_Surface's memory. Once you got the image, you create a wxBitmap based on the wxImage. I really hope this isn't double-memory copying and that the wxImage uses the actual memory.
// create a bitmap from our pixel data
wxBitmap bmp(wxImage(m_Screen->w, m_Screen->;h,
static_cast{unsigned char *}(m_Screen->pixels), true));

(NOTE: I use braces instead of less than and greater than because the code
is altered by blogger's html tidying routines)
4) Now that we created the bitmap, we can safely unlock the SDL_Surface.
   // unlock the screen
if (SDL_MUSTLOCK(m_Screen)) {
SDL_UnlockSurface(m_Screen);
}
5) The painting is done with standard techniques:
   // paint the screen
wxBufferedPaintDC dc(this, bmp);

For our purposes, the SDL_Surface can be a software bitmap without 3D acceleration, residing in the computer's RAM. In other words, it's a plain and simple memory buffer.

And I had to load a full-fledged multimedia library for a simple in-memory bitmap!?!? C'mon!! But hey, it works :D

Here's the screenshot (note: the little color lines actually vary in real-time, it's cool).


Sweet, isn't it? Too bad I'll have to change the code back to keep working on this.

But from this we can incorporate the VideoOutputDevice class so we can actually display clips and images. This will be a major breakthrough in our editor.

Wednesday, July 23, 2008

First experiences with SDL

It's time for Saya to get a video viewer, but we havn't been able to do anything yet. Enter wx-sdl.

wx-sdl is a tutorial/sample of using SDL with wxWidgets. It's a single file, and it has everything you need to draw your own video on a screen surface. The best thing is that it's LGPL licensed, so it won't be a problem including it in Saya! :D (two thumbs up!)

There's a class called SDLPanel, but it's customized for the sample there, so we need to adapt it to make it generic. But the integration with wxWidgets is amazingly simple. I hope I will have it included in Saya by the next week.

In related news, I had thought that including the SDL source code would be piece of cake. I guess I was wrong - it's a huge library, so I guess it will go along with wxWidgets in that I need to link to it instead of embedding it.

Fortunately, all linux distros already include it or have RPMs for it, so installation won't be a problem. And you don't need to compile it in Windows either, it already comes with a handy-dandy DLL :)

That means I'll need to post another edition for the developers' guide... sigh.

New developer joined!

Everyone, give a warm welcome to Robert Molnar a.k.a. wireshark. He's an experienced wxWidgets programmer (i think the first assignment i'll give him is to start designing the timeline :) ), and has helped a lot of other programmers at least in the wxForum. He's certainly got what it takes to develop a full-fledged Video Editor such as Saya.

Welcome aboard!

Monday, July 21, 2008

Congratulations! It's a boy!

It's time to celebrate. Our effort has given birth to our first offspring. What the - offspring? Actually, I'm talking about Nopalin's first code commit ^_^ Well, I had to help a little, but the new project dialog is progressing. Congratulations!

Oh - by coincidence, it turned out to be my birthday. So it's a double celebration then :)
In other news, I finally figured out how to implement the video display and keep the current framework design. I'll try to do the first tests this week. Wish me luck!

Wednesday, July 16, 2008

Expensive decision; Improved New Project Dialog

Two good news: I asked for permission at my job to work one hour less (without pay, of course) than I normally do - starting today - , and my boss accepted. This decision costed me a lot of money that I won't earn anymore, but it's certainly worth it - and the result is that today I could finally work a lot of time in Saya.

As proof, and that's the second good news, here's the improved New Project Dialog, based on the GNOME Human Interface Guidelines (not all were followed, but it's an improvement) :

Before:



After:



As you can see, the new dialog is thinner and less cluttered. Also, I removed the redundant "Aspect Ratio" combo box. Pixel Aspect is more than enough for the video settings. If later we decide to scale the project to a certain screen format, I'll add a button to calculate the pixel aspect ratio.

(Note: The cyan background for the text controls is a personal desktop setting, just pretend there was white in there).

Tuesday, July 15, 2008

Developers' guide for Linux uploaded!

Oops. Make that "GNU/Linux". Anyway, thanks to CJ Barker for the draft. The files are available on Sourceforge.

Job + personal problems + stress = ???

Sigh. It's been more than a month since the project was founded, and it feels like I haven't been able to acomplish anything.

These last 3 weeks, I've had too much work at the job, plus I've had personal problems at home. These have left me exhausted and without time or energy to work on the project when I get home.

Without realizing that, I opened the project and saw that very little code has been written. So I asked myself: what the heck have I / we been doing this month? I felt so frustrated and impotent. It's even worse when I can't get a quick e-mail reply from one of the team members. What will happen if I we keep having the same problems / interruptions and we can't get anything done in the next 3 months?

But then I realized that I've written the developers' guide (a task not trivial at all), an explanation of the project design, and the other developers have been organizing themselves.

Yes, it's true, not much code has been written, but it won't be like this forever. CJ Barker has mailed me telling me that he'll have time this weekend to work on the resources panel. Nopalin is putting a lot of effort in learning wxWidgets, and more research has been done.

Tonight I'll start rewriting / publishing the Linux developers' guide (thanks to CJ for writing the first draft).

Anyway I've also noticed a lack of organization. I'm thinking that perhaps we should have monthly meetings on the irc channel - that's why it was created in the first place.

So, please bear with us a little more. We're not perfect, but we're not slackers either. We're very few members and we're doing our best to make this work.

Monday, July 14, 2008

Car accident; Human Interface Guidelines

The bad news: One of our team members had a car accident and he had to be taken to the hospital :( Fortunately, he's fine now, but he'll need a bit of rest. Let's wish him a fast recovery.

The good news: After a brief discussion (but not argument) with some of the team members, I've decided to follow the Gnome Human Interface Guidelines. This will make our dialogs VERY user friendly and not cluttered at all :)

Thursday, July 10, 2008

New dev, engine warming up :)

Two good news: One, we got a new dev, Rigo, which is an old friend from school.
Two, everyone's back from their away status. Nopalin has been studying hard and is learning fast. I hope that the New Project dialog will be completed soon.

Also, the "Welcome" dialog has been fixed from some bugs and some bitmaps have been added to the big buttons.

It seems that the real development has been started! :)

Stay tuned.

Saturday, July 5, 2008

Framework design is up!

The Saya-VE framework design has been uploaded to the website (it's licensed as GNU FDL) . Also, the developers' guide section now points to the downloadable dev guide.