Documents

Archives

Search

BLOGical Thoughts Archive

November 2009

Monday, 30 November 2009

I have finished the gdvdslides program. I have created a Debian package for it to make it easy to install in any Debian-based distro, including Ubuntu. The 32-bit gdvdslides package is on my Rimrock Software web site. You can download it and open it with the Gnome package installer gdebi. It requires a couple of other packages, which should also be installed when gdvdslides is installed.

The program has fairly extensive help, including a step-by-step tutorial. Just click on the gdvdslides Help menu item. If you have any problems with the program, you can contact me at michael dot burton at rimrocksoftware dot com. That is the email help address for the program.

There is no supporting web page for the program at this point. I ran out of gas last night after I got the Debian package working, so I never got to the supporting web page. I have put up the program help as an online manual at http://www.rimrocksoftware.com/programs/gdvdslides/manual/index.html.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Wednesday, 25 November 2009

Most of the time, programming is a matter of logic and layout; what programming steps to perform and how to present the results to the user. Every once in a while, though, programming involves math calculations that affect logic and layout. I ran into such an occasion when I decided to only allow rectangles to be drawn in gdvdslides that had the proper width to height ratio.

As I have mentioned before, the video generated with gdvdslides (using dvd-slideshow) can have a width to height ratio of 4:3 or 16:9. In order to coerce the drawing into such a rectangle, the program has to let the user control one of the dimensions, while the program controls the other. I chose to have the user control the width, and let the program control the height.

There are three events that must be processed when you draw in a program: OnMouseDown, OnMouseMove and OnMouseUp. The OnMouseDown event occurs when a mouse button is pressed. The OnMouseMove event occurs when the mouse cursor is moved over the drawing area and the OnMouseUp event occurs when the mouse button is released. When the mouse button is pressed, we record the current mouse cursor position as the starting coordinates of our box. When the mouse cursor is moved, we constantly update the end position of our box and redraw the box. When the mouse button is released, we know we are done, so we finalize the coordinates.

The OnMouseMove event is where we need to do our changes. Instead of just using the coordinate given to us, we need to calculate a new height coordinate. And that is where I screwed up. Instead of sitting down and thinking about what I was really doing, I came up with a math formula that looked like it worked. It did not, though, and I found that out yesterday by drawing a bunch of rectangles and measuring their height to width ratio. Instead of .75 (3:4), the ratio was anything between .43 to .86. Bad bug.

Once I discovered this problem, I sat down and analyzed the problem and ended up with the proper formula. The problem is then very simple: we need to produce a height length that is 3/4 of the length of the width, and add that to the starting height coordinate. The length of the width is

   Abs(CurX - AnchorX)

Note that we take the absolute value, since we don't know if the user is drawing from left to right or vice-versa. We then multiply by the height ratio and divide by the width ratio to get the length of the height:

   iHeightMul * Abs(CurX - AnchorX) div iWidthMul

Now all we need to do is add that to the starting height position. Or do we? What if the user is drawing from the bottom to the top? In that case the value would be subtracted. So instead of the simple assignment for an 'any size' rectangle

   CurY := Y;

We end up with this

   if Y < AnchorY then
CurY := AnchorY - (iHeightMul * Abs(CurX - AnchorX) div iWidthMul)
else
CurY := AnchorY + (iHeightMul * Abs(CurX - AnchorX) div iWidthMul);

This is the proper calculation and it works like a charm. So I guess the moral is: if you are sure you are doing a calculation correctly, step back and define what it is you are attempting to do, then develop the calculation.


My next post will be next Monday. I hope everyone enjoys Thanksgiving and Black Friday.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Tuesday, 24 November 2009

It took me quite a while yesterday to get the graphical marking on images in gdvdslides to work right. This marking is used to define a crop effect or a Ken Burns effect. I have set the program so that when you draw the rectangle, it is drawn at a 4:3 or 16:9 ratio - whichever ratio you have selected for the output is used. Doing this prevents you from defining an image that will not fill the screen. We don't really want the background to be displayed when you display the slide.

I have started documenting this. It will take quite a bit of explanation, which is what I will be finishing up today. I can then (finally) get on to the packaging. The final step will be to post it.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Monday, 23 November 2009

I wrote up a to-do list for gdvdslides on Saturday. It only had two items on it - things that needed to be added to the program so it would be more useful. Doing that list started me thinking about how to do the items, and the next thing you know, I was working on those items. I am almost finished.

The first item in the list was simple. I added an Open Recent entry in the menu, with a list of slideshow scripts that had been worked on. The most current one is always placed at the top of the list. The code for this was straightforward. The only hard part was saving the file names in the configuration file and restoring them when the program starts up.

The second item was harder to do. I have controls in the program for doing crop and Ken Burns effects, but you had to fill them out mostly by guessing. I added the capability to draw rectangles on the preview image and have the controls filled out with the values. It was lots of code and it still needs a few tweaks, but it really works. I did a Ken Burns effect on one image, zooming from the full image down to a specific area in the image. It worked great, but it sure takes a lot of computer horsepower to render that effect.

I hope to get back to working on the debian package for this program today, after my dental appointment.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Friday, 20 November 2009

I enjoyed my night off last night, just like I will enjoy having all next week off from work. It will be a lot nicer than having to diagnose why one of our programs does not run under Windows 7 (which is what I will be doing most of today).


I did spend some time yesterday fixing spelling errors and awkward grammar in the gdvdslides help. I also fixed a couple of small bugs in the gdvdslides code. I think I may have accidentally erased all those changes without saving them, though. I will know if I did that later today.


Update: Never, ever ask me to help you with your Microsoft Windows Vista or Windows 7 computer. With Windows 7, Microsoft has achieved a level of suckitude hitherto unknown to mankind.


Silly sign of the day:


Free/Open Source Software

Thursday, 19 November 2009

I have finished writing the tutorial for gdvdslides. I need to do some editing, but tomorrow I will move on to packaging the program and its source. Almost done with it.

Tonight I will take a break and go to the North Idaho Mineral Club meeting. I need to work on that web site, too, so I have to figure when I can get to that.


At work, I've been trying to verify that some bugs in our software were fixed. These bugs were specifically written against 32-bit and 64-bit Windows 7. Everyone is just 'raving' over how good Windows 7 is. I can tell you that in some instances, it is worse than Vista. And it certainly is not compatible with a lot of Windows software. Why would anyone in their right minds (i.e., not brainwashed) buy such terrible software? Oh yeah, people are sheep. I get it.

All this 'modern' operating software work leaves me very ill-tempered by the end of the day.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Wednesday, 18 November 2009

I finished the gdvdslides help page on transitions. While working on that, I came across some minor bugs in the program, so I went ahead and took care of them, too. I am now working on the tutorial for the program. That is slow going, as I need to explain all the actions I take when using the program. I will also take screen shots so I am completely understood.

Next up after the help is to create a Debian package to hold gdvdslides. I also need to add support for it on rimrocksoftware.com So, lots to do. I am taking next week off, so I will be able to accomplish all manner of tasks (I hope).


No eBook reader in site and no response to the (loud) request to tell me where it is that I emailed yesterday.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Tuesday, 17 November 2009

I am still working on the documentation for gdvdslides. It is slow work to completely document the actions of each control in a program. And after I do that, I have a tutorial to write, too. At least it kept me from recompiling the program last night.


If you want to get an eBook reader, don't get the Cooler Reader. The device is nice and works well, until it breaks and you have to get it fixed. I sent it back to be fixed and they have had it for over three months. I send them emails and they say they will ship it. I don't believe that. I believe they took my $250 and ran. I also believe I will have to take action to attempt to get my money back.

Too bad. It's the only reader out there that supports so many eBook formats and does not support DRM.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Monday, 16 November 2009

While I was demoing gdvdslides to the North Idaho Linux Users Group on Saturday, I noticed that a bug I thought I had fixed was still present. After careful analysis, I determined what the problem was, but the only way to fix it was a fairly hefty rewrite of some of the code. I did that, and the problem is now fixed. I will continue to look at the program and fix any bugs I find, but I am now doing the documentation.

I have written help pages for all but one of the dialogs. After I finish that one, I will do the tutorial web page. The documentation will then be complete and I can work on the Debian packaging.

I created a Flash file with gdvdslides on Sunday, and it seems to work fine. If I can figure out how to create the HTML to display it here, you will see it soon.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Friday, 13 November 2009

I finished adding the items I found in the dvd-slidshow code. I created a slideshow with a video clip embedded and that works fine. The only option I haven't tried is the logo option, which puts a logo on each slide of the slideshow. So now I can go back to the documentation and to creating the installation package.

I will demo gdvdslides at the North Idaho Linux Users Group tomorrow afternoon. I hope they think it is a worthwhile project.


Friday the Thirteenth is on Friday this month. Happy TGIF!


Silly sign of the day:


Free/Open Source Software

Thursday, 12 November 2009

The dvd-slideshow program is actually just a bash script. I looked through it to verify that I had not missed anything when I wrote gdvslides. It turns out there were four more items not included in the dvd-slideshow that I could implement in gdvdslides. So I did that. One of them is pretty cool. You can actually embed an AVI video file within the slideshow. You can also elect not to play the audio from the AVI file, but play your own audio. Way cool.

Needless to say, this has delayed my gdvdslides documentation efforts.


The SpinIt Pro editor has some problems working under Wine in Linux, so I will abandon using it. When I click on a control in a program, I expect to be have that control execute, not some other control. I also expect the window to be refreshed so that all the controlls are displayed properly. I guess in this instance, Wine does not work well. I have uninstalled SpinIt Pro.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Wednesday, 11 November 2009

I have started writing the help files for gdvdslides. I began doing this using Quanta Plus, but was unhappy with it. So I dragged out a fancy Windows HTML editor called SpinIt Pro that I wrote at least 10 years ago. I installed it on my Linux workstation using Wine. It works great and I am a much happier camper. It's biggest advantage is that it helps you along with the various attributes for HTML tags, and it has a new file wizard that allows you to define a lot of the stuff you put in the HEAD section of the page. It is not a WYSIWYG editor, but it has a display mode like Quanta Plus. The only bad part of that is the display part is based on a component that only knows about HTML 4.

The editor is highly configurable, too. I can add or remove HTML tags from the menus, as they are not built in to the program, but are all defined in text files. If I had the time and the inclination, I would convert the program over from Windows to Linux. I don't, so I'll just have to put up with it as a Wine program.


The gdvdslides help will have detailed information about the program and the controls in the program. It will also have a tutorial on how to use the program to create video slide shows. Basically, there will be probably twice as much documentation for it than for most small Open Source programs. This is not a criticism of them, it's just a fact. If I ever retire from my day job, I will look into doing open source documentation on my favorite programs. Some of them really need it.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Tuesday, 10 November 2009

I have fixed all the small bugs in gdvdslides that I found, but I keep finding things that need to be reorganized or redone. Despite that, I hope to be completely through with the program by the weekend. I then have to write the help file for the thing, and package all of it.

I suspect that the documentation for dvd-slideshow has not kept up with changes to that program by its author. If that is true, there will be options in it that I have not covered in gdvdslides. I will look at that when everything else is wrapped up.


Sunday night, I put 21 books up for mooching at Bookmooch.com. By yesterday afternoon, 14 of them had been mooched. I thought that not much was going on at Bookmooch. I guess I was wrong. At any rate, I have 10 packages of books to mail today (some people mooched more than one book). My problem now is I have way more points than I have books to mooch. I will have to come up with new authors to read, I guess.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Monday, 9 November 2009

I know I said I finished gdvdslides on Friday. I took another look at the capabilities I had left out and decided to implement them. So now gdvdslides allows you to create a dvd-slideshow script that can have anything in it that dvd-slideshow can process. The only thing missing is a graphical layout of the crop and kenburns effects, but I will do that much later.

I found a couple of small bugs that I will fix, then I will demo gdvdslides at the North Idaho Linux Users Group meeting on Saturday, showing how easy it is now to produce a slide show from a mess of JPEG files.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Friday, 6 November 2009

I have finished gdvdslides. I added a button that allows the user to copy the last transition selected into the image list. I also added a button that turns off the display of images. I did that because it takes a while to go out and get the image, then load it from the file and compress it so it fits in the display. This way, you can rapidly move through the image list without having to wait for that.

I also cleaned up the effects section of the program. I now allow the user to decide when the effect should be applied to the image. Finally, I fixed a bug where an exception was being thrown when you deleted the last entry in the image list.

gdvdslides is ready for alpha testing. If you are interested, email me and ask for it. I only have an executable to distribute right now. I have not yet created a .DEB package for it, but there are only two dependencies. One is gtk2+ (if you have Gimp or Gnome, you have that) and the other is dvd-slideshow. You can get that from the debian or Ubuntu repositories. All you have to do is copy the gdvdslides executable someplace, make sure you own it and it is executable, then run it.

I am working on the .DEB package and on documentation for the program. I thought a video explaining how to use it would be very useful.


I have signed up to another web host and am reactivating rimrocksoftware.com with them, in support of gdvdslides and any other open source or free programs or files I want to put out for the public.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Thursday, 5 November 2009

A good way to find bugs in a program is to use it for actual work. That's what I've been doing with gdvdslides, the GUI for dvd-slideshow. I converted each of the last seven sets of photos I took at the Northwest Teardrop Spring Fling into video clips. Whenever I found a problem with gdvdslides, I fixed it for the next video clip. That seems to work just fine.

Once I had created all the photos into video clips, I used DeVeDe to create an ISO image of a video DVD. I set up the clips so that when one is finished, it automatically goes to the next clip. It actually took DeVeDe longer to create the ISO image than it took gdvdslides to create the clips in the first place.

There is one section of gdvdslides that is kind of unwieldy. When you add a transition effect, you select a slide and click a button, which puts up a dialog. Pick the transition and click Ok, then the transition is put in front of the selected slide. Those actions are repeated for each slide. That is way too much mouse clicking. I finally did the transition for just the first slide, saved the file, then opened it in a text editor, where I copied the transition line and pasted it between all the other slides. I have to find a way for gdvdslides to do that just as easily.


"Remember, remember the fifth of November,
The gunpowder treason and plot,
I know of no reason
Why the gunpowder treason
Should ever be forgot. ."
Kudos to Guy Fawkes.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Wednesday, 4 November 2009

I did some code cleanup in the GUI for dvd-slideshow, then I tried a full-fledged video creation using 86 images. I ran into some problems when too much got added to the script, so I will have to track down what that is all about. I did get to the video creation part, and it did a great job. I now have a 12 minute video of all the pictures I took at the 11th Northwest Teardrop Spring Fling.

I suspect that the problem I encountered is a memory limitation. If that's true, I can increase some of the memory allocations. The problem is really weird. the toolbar buttons and the menu stop working, but everything else works fine. I guess I will also have to check to see I didn't accidentally disable the toolbar.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News

Tuesday, 3 November 2009

The GUI for dvd-slideshow is complete, except for debugging minor problems. I tried to use a separate thread to do the actual dvd-slideshow creation, but that failed. It would go for a while, then hang up and consume most of the machine's resources. So I went back to the dialog window model and it failed in the same way. To find out what the problem was, I opened up a terminal and entered the command line for what was running in the program.

It turns out there was an error in the script. At the end of the script, I had a fade-in, but there was no slide to fade in to. I removed the fade-in and the video creation went fine.

That debugging pointed out to me that the user has to absolutely see what is going on, so the program is now launching a terminal window with the command line to execute. That works great and if there is no problem, it shuts down when it is finished. If there is a problem, it sits there with the problem text in the window, and you can do a Ctrl-C to exit. Not as elegant as I'd like but it works well. As an aid, I added an edit box in the default settings to allow a user to add the terminal program of their choice. The default is gnome-terminal, with a '-e' option.


Silly sign of the day:


Free/Open Source Software

Monday, 2 November 2009

I finished the two parts of the GUI for dvd-slideshow. It will now load a saved slideshow script from a file, and it will invoke dvd-slideshow to create a video from the images.

There is still a problem, though. I set the program up so the output from dvd-slideshow would be displayed in a modal dialog while it was creating the video. I ended up with an empty dialog, as dvd-slideshow is very, very CPU-intensive and nothing else got enough CPU cycles to refresh. It looked like the GUI was broken, as it faded to gray when dvd-slideshow ran.

To alleviate this problem, I will create a separate program thread and run the dvd-slideshow creation in that thread. I will show the creation status in the original GUI window, but there will be no visual dvd-slideshow status. dvd-slideshow creates a log of it's activities, so that will have to do for debugging a slideshow script.


Silly sign of the day:


Free/Open Source Software

"It's Mine, and You Have to Pay (and Pay and Pay) For It"

Local and Other News