Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_imgburner (Read 22531 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_imgburner

This component burns selected files using ImgBurn.

It's really basic, all it does is create a cuesheet of selected files then launch ImgBurn. It does not convert to WAV (you'll need directshow filters to burn OGG, FLAC or other formats - this one for example) and it burns the file on the same order they are on your playlist. I'm not good enough with C++ to implement any of these features.

As preferences pages seems a little too complicated for me, the component is configurable via Advanced Preferences > Tools > ImgBurner. You can set ImgBurn path, drive address and check some parameters. I advise you to read ImgBurn's readme if you want to add additionnal commandline switches or change the drive address. Just note you don't need /WAITFORMEDIA and /SPEED MAX as they are implemented by default, and of course you can't use /MODE, /SRC and /DEST.

If you want to have a fully automated burning process, you'll have to go to ImgBurn Settings, "Write" tab, and tick "Don't prompt Delete Files" and "Answer No" just after. If you don't, ImgBurn will ask each time if you want to delete the source files (source = your music, not the cuesheet) after burning, if you use the /DELETEIMAGE switch.

This is my first plugin, and my first C++ project in at least seven years, so it may be awfully buggy. It works for me on my two computers (XP SP2 and SP3), but I have no idea if it works with Vista or 64 bits systems. Please report any problem you encounter.

I stole some of the cuesheet creation code to foo_cuesheet_creator, so thanks to the authors, and thanks to foosion for his tutorial.

Download : foo_imgburner 0.3.1 (source)

Changelog :

v0.3.1 (2008-10-30)
- Added possibility to specify a temporary folder (leave %TEMP% for system temp folder)
- Cleaned up some evil code

v0.3 (2008-10-28)
- Added possibility to burn data CD with MP3 files ( naming scheme via titleformatting in the options )
- Somes fixes here and there / code cleaning
- Added readme
- Released source

v0.2 (2008-10-21)
- Added checkboxes in configuration
- Added prompt before lauching ImgBurn

v0.1 (2008-10-17)
- Initial release

foo_imgburner

Reply #1
Very welcome for people who don't want Nero on their system (because it's not freeware!).

A little more documentation along this plugin should be nice, in the form of a readme file or something.

I hope it's possible to burn mp3's to a disc, without changing the format. Many caraudio systems support mp3 (or wma) so that would be nice... (listening in the car is the only reason I burn cd's).

Can't find anything about optional parameters.

foo_imgburner

Reply #2
For now, it only burns audio cd's, not directly mp3's, but it would be quite easy to implement. I'll look into that.

I did not write any documentation because I think the options speak for themselves. It's weird you don't find them, I just tried on a fresh install of 0.9.5.6 and 0.9.6 beta 1, and they show in foobar's Preferences, Advanced, Tools, ImgBurner.

foo_imgburner

Reply #3
Awesome! Thank you!
elevatorladylevitateme

foo_imgburner

Reply #4
For now, it only burns audio cd's, not directly mp3's, but it would be quite easy to implement. I'll look into that.


+1 for that request! Having a direct burn function for mp3 CDs would be great.


foo_imgburner

Reply #6
For now, it only burns audio cd's, not directly mp3's, but it would be quite easy to implement. I'll look into that.

Well, this is actually easy to implement, but as ImgBurn is not really designed to build data cd's, we don't have many options :
- burn all the selected files, but everything will be at the root folder of the cd (and ImgBurn is not happy if there are 2 files with the same name)
- burn the entire folder of every single selected file, even if only one file is selected by folder (and I don't think that would be convenient)

I think the first option is the best, but I don't have any hifi or car system that handle mp3's, so I don't know if they work with tags or folder structure...

foo_imgburner

Reply #7
Any chance we could see a source code release so we can tinker around with it?

foo_imgburner

Reply #8
I'll explain how my caraudio works (Kenwood).

It eats all sorts of mp3, no matter what bitrate or profile is used. It reads the tags, if those are not available the filenames.

It sorts by filenames though, so 01. A is the first track played.

It also supports folders, also in alphabetical/numerical order.

I would be very happy if it just burns files in the root of the cd, output filename based on tags or something. Your component would be very foobarworthy if it lets the user customize the filename based on tagz. If that's too hard to implement, i would be very happy also if it just burns the mp3's the way they are to a cd.

foo_imgburner

Reply #9
Any chance we could see a source code release so we can tinker around with it?

Of course, I'll just clean the code a little before releasing the source. 

I would be very happy if it just burns files in the root of the cd, output filename based on tags or something. Your component would be very foobarworthy if it lets the user customize the filename based on tagz. If that's too hard to implement, i would be very happy also if it just burns the mp3's the way they are to a cd.

The problem does not come from foobar, but from ImgBurn. It just takes a file list and burns it as it is, without renaming possible. Well, there's still a solution : copying all the files to a temporary folder, organizing them like the user wants (folders, names, etc.), burn then delete them. I'll look in the SDK to see how difficult it is to copy and rename files.

foo_imgburner

Reply #10
Well, that was easier than I thought. I added the possibility to burn a data disc with mp3's or other files. The selected files are copied to your %TEMP% folder, named and structured via titleformatting, then burned to a disc and deleted after success.

There may still be some bugs : I only tested with 700mb of files, I don't know what happens if your %TEMP% drive is full, and only tested a few titleformatting strings. Please report any problem you encounter.

I also included a Readme (sorry for the bad english), and released the source. Please don't laugh (I already said I was no good with C++) and instead tell me what I'm doing wrong. Oh, and sorry for the french comments, I didn't felt like translating them.

I'm still open to feature requests, but I may not have a lot of time to work on complicated things in the near future.

You can download all this up there in the first post.

foo_imgburner

Reply #11
Code: [Select]
metadb_handle_ptr item = p_data.get_item(i);
entry.m_file = str_replace(item->get_path(),"file://","");

>>>

        char* str_replace( const char* s, const char* m, const char* n )
        {
                int sS = strlen( s ), sM = strlen( m ), sN = strlen( n );
                char* c = (char*)s;
                while( c = strstr( c, m ) ) {
                        memmove( c + sN, c + sM, sS - ( s - c  ) + 1 );
                        memcpy( c, n, sN );
                        c += sN;
                }
                return (char*)s;
        }
Uhm, how dare you retype the (const char*) returned from metadb_handle::get_path() to (char*) and modify it? You should definitely do that on your own copy of the string.

Or, considering what you are using it for, maybe do it even simpler:
Code: [Select]
const char *remove_file_protocol(const char *path)
{
  return strncmp(path, "file://", 7) ? path : (path + 7);
}
Full-quoting makes you scroll past the same junk over and over.

foo_imgburner

Reply #12
Great work olaf!! Many kudos, I will test this in the coming few days, and try to create some difficult renaming scheme for the copying.

Maybe a feature request allready, the possibility to set a temp-folder location?

foo_imgburner

Reply #13
Yirkha> Thanks, that was a function I copy-pasted from a google search back when I modified foo_cuesheet_creator for my use, and I did not care to look into it when I started this component. I'll try yours.

Mar2zz> That is a request that seem simple enough to implement quickly. I'll hopefully release a new version tonight. (EDIT: well, maybe tomorrow )

foo_imgburner

Reply #14
Version 0.3.1 is out, with the possibility to specify the temp folder, and the ugly code cleaned up.

I totally forgot the source on a computer I won't have access to until about 2 weeks, so the source available is still for v0.3. I hope there are no bugs, I won't be able to make corrections during this time...

foo_imgburner

Reply #15
This component doesn't handle when a song is part of a cuesheet already. The component creates the temp CUE file and refers to the .cue which could work if it was smart enough to use the associated .mp3 instead. Looks like foobar2000 doesn't have any API for this so you would need to check if the source file is indeed a .cue and then open this file to get to the actual MP3, FLAC or whatever.
As cuesheets are usually used for full albums anyways you can just burn that CUE directly with imgburn so I don't really see a need for this functionality myself. But other people may need it.

foo_imgburner

Reply #16
Updated source to the latest version.

saivert> The problem with cue files is that they can also point to parts of an image file, and I can't handle that without converting, and I don't have time/motivation to implement this feature. I think I could ignore cue files, though, because having a .cue pointing to another .cue is pointless.

foo_imgburner

Reply #17
Bump, but is there any way to not make ImgBurn crash when using Unicode filenames?

foo_imgburner

Reply #18
Can you elaborate more on your problem ? I don't recall having trouble with unicode filenames.

foo_imgburner

Reply #19
Just wanted to let you know I got it working beautifully in Vista 32 bit. Thanks for writing this plugin, it lets me do what I've wanted to be able to do in foobar for a very long time (without having to deal with Nero- yuck).

I simply installed the plugin and the directshow filters that you linked. Now I can Right Click->Utils->ImgBurn directly from FLAC. Wonderful.

foo_imgburner

Reply #20
Very welcome for people who don't want Nero on their system (because it's not freeware!).
...
I just want to let you know that there's an update to the official audio cd burning component. It doesn't require nero anymore (no 3rd party software at all) but you should click the documentation link, since for windows versions before Win 7 you need to download and install the IMAPIv2 redistributable package from Microsoft.

foo_imgburner

Reply #21
Thank you - great plug-in!
 
The only question: I have my newest K-Lite Mega Codec Pack installed with all codecs (ffdshow, Ogg, Flac, Monkey etc.) Why am I still asked by ImgBUrn to install additional filters then?
Will they be compatible with K-Lite if I'll install them?

foo_imgburner

Reply #22
Well, I don't really know which codecs K-Lite installs and how it installs them, nor what ImgBurn needs... Maybe K-Lite installs codecs only usable by its player, without integrating them into the system. I don't think installing directshow filters will break K-Lite, but if you want to be sure you can ask in their forum (or in ImgBurn forum to know why it doesn't work with K-Lite).

foo_imgburner

Reply #23
Well, I don't really know which codecs K-Lite installs and how it installs them, nor what ImgBurn needs... Maybe K-Lite installs codecs only usable by its player, without integrating them into the system. I don't think installing directshow filters will break K-Lite, but if you want to be sure you can ask in their forum (or in ImgBurn forum to know why it doesn't work with K-Lite).

Hi Olaf,

Thanks for reply and for idea - I'll ask for advice in IB-forum
Because K-Lite does intall itself into the system, so that different programs like Virtual Dub and not only can use these codecs for all kinds of encoding-decoding. But
everywhere in i-net you can find the warnings about difficulties when you use different packs at the same time. I'll find out about it and let know in this thread

Regards,

De UKKIE

foo_imgburner

Reply #24
As for ImgBurn and codecs: ImgBurn only uses DirectShow decoders to decode the files to PCM WAV before burning.
Also you need a file source filter in additon to the decoder itself. So for flac you can install madFLAC (on doom9, use google) which includes both a source filter (for opening the .FLAC format file) and the FLAC decoder. For other formats you may have luck with ffdshow (only thing you need as it handles pretty much any popular format today) but remember this needs appropriate source filters as well. (sometimes I wish ffdshow could just include source filters for all the codecs it supports).